@enablerr-ui/detail 0.3.44 → 0.3.46
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.min.js +2 -2
- package/package.json +1 -1
package/dist/index.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],function(exports){"use strict";var Request,Storage,task_notification,currentRoles,TextArea,toasts,settings,Page,getAttractions,PopOver,user,taskClipboard;return{setters:[function(t){Request=t.Request,Storage=t.Storage,task_notification=t.task_notification,currentRoles=t.currentRoles,TextArea=t.TextArea,toasts=t.toasts,settings=t.settings,Page=t.Page},function(t){getAttractions=t.getAttractions,PopOver=t.PopOver},function(t){user=t.user},function(t){taskClipboard=t.taskClipboard}],execute:function(){function _mergeNamespaces(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})}),Object.freeze(t)}const version=exports("version","0.3.44"),checkDate=exports("checkDate",(t,e)=>"string"!=typeof t||t.length<20||!(e=t.split(" · "))?t:e.map(t=>2===t.split("T").length&&3===t.split("T")[0].split("-").length?new Date(t).toLocaleDateString():t).filter(t=>!!t).join(" · ")),checkDateTime=t=>{try{return new Date(t).toLocaleString()}catch{return t}},checkDateRange=(t,e)=>{let n,r;try{n=e[t+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{r=e[t+"_to"],r=new Date(r||"").toLocaleDateString(),"Invalid Date"===r&&(r="")}catch{r=""}return[n,r].filter(t=>""!==t).join(" - ").trim()},checkBoolean=t=>t?"(ja)":"(nein)",getRecordDescription=(t,e)=>{if(!t.display&&!t.items)return"";const n={...e};return(t.display?.reduce((e,r)=>{let[o,i]=r.split(".");if(t.list?.find(({name:t})=>t===o)&&i&&void 0!==n[o]){const t=`${o}_${i}`;n[t]=n[o][i],o=t}return e.find(t=>t===o)||e.push(o),e},[]).map(t=>"boolean"==typeof n[t]?checkBoolean(n[t]):checkDate(n["_"+t]||n[t]))||t.items.map(t=>"object"===t.type?e["_"+t.name]:"list"===t.type?"":("boolean"==typeof e[t.name]&&checkBoolean(e[t.name]),e[t.name]))).map(t=>t?.toString().split(" · ").filter(t=>!!t&&!checkObjectId(t)).join(" · ")).filter(t=>!!t).join(" • ")},checkObjectId=t=>/^[0-9a-f]{24}/.test(t),getData=(t,e)=>{try{return e.split(".").reduce((t,e)=>t[e],t)??""}catch{return""}},addDays=function(t,e){var n=new Date(t);return n.setDate(n.getDate()+Number(e)),n};function noop(){}function is_promise(t){return t&&"object"==typeof t&&"function"==typeof t.then}function run(t){return t()}function blank_object(){return Object.create(null)}function run_all(t){t.forEach(run)}function is_function(t){return"function"==typeof t}function safe_not_equal(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function is_empty(t){return 0===Object.keys(t).length}function subscribe(t,...e){if(null==t)return noop;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function component_subscribe(t,e,n){t.$$.on_destroy.push(subscribe(e,n))}function null_to_empty(t){return null==t?"":t}function set_store_value(t,e,n=e){return t.set(n),e}function append(t,e){t.appendChild(e)}function insert(t,e,n){t.insertBefore(e,n||null)}function detach(t){t.parentNode.removeChild(t)}function destroy_each(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function element(t){return document.createElement(t)}function svg_element(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function text(t){return document.createTextNode(t)}function space(){return text(" ")}function empty(){return text("")}function listen(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function prevent_default(t){return function(e){return e.preventDefault(),t.call(this,e)}}function stop_propagation(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function attr(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function children(t){return Array.from(t.childNodes)}function set_data(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function set_input_value(t,e){t.value=null==e?"":e}function set_style(t,e,n,r){t.style.setProperty(e,n,r?"important":"")}function toggle_class(t,e,n){t.classList[n?"add":"remove"](e)}function custom_event(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}let current_component;function set_current_component(t){current_component=t}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(t){get_current_component().$$.on_mount.push(t)}function onDestroy(t){get_current_component().$$.on_destroy.push(t)}function createEventDispatcher(){const t=get_current_component();return(e,n)=>{const r=t.$$.callbacks[e];if(r){const o=custom_event(e,n);r.slice().forEach(e=>{e.call(t,o)})}}}function bubble(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(t=>t(e))}const dirty_components=[],binding_callbacks=[],render_callbacks=[],flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function tick(){return schedule_update(),resolved_promise}function add_render_callback(t){render_callbacks.push(t)}function add_flush_callback(t){flush_callbacks.push(t)}let flushing=!1;const seen_callbacks=new Set;function flush(){if(!flushing){flushing=!0;do{for(let t=0;t<dirty_components.length;t+=1){const e=dirty_components[t];set_current_component(e),update(e.$$)}for(set_current_component(null),dirty_components.length=0;binding_callbacks.length;)binding_callbacks.pop()();for(let t=0;t<render_callbacks.length;t+=1){const e=render_callbacks[t];seen_callbacks.has(e)||(seen_callbacks.add(e),e())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,flushing=!1,seen_callbacks.clear()}}function update(t){if(null!==t.fragment){t.update(),run_all(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(add_render_callback)}}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(t,e){t&&t.i&&(outroing.delete(t),t.i(e))}function transition_out(t,e,n,r){if(t&&t.o){if(outroing.has(t))return;outroing.add(t),outros&&outros.c.push(()=>{outroing.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function handle_promise(t,e){const n=e.token={};function r(t,r,o,i){if(e.token!==n)return;e.resolved=i;let a=e.ctx;void 0!==o&&(a=a.slice(),a[o]=i);const s=t&&(e.current=t)(a);let c=!1;e.block&&(e.blocks?e.blocks.forEach((t,n)=>{n!==r&&t&&(group_outros(),transition_out(t,1,1,()=>{e.blocks[n]===t&&(e.blocks[n]=null)}),check_outros())}):e.block.d(1),s.c(),transition_in(s,1),s.m(e.mount(),e.anchor),c=!0),e.block=s,e.blocks&&(e.blocks[r]=s),c&&flush()}if(is_promise(t)){const n=get_current_component();if(t.then(t=>{set_current_component(n),r(e.then,1,e.value,t),set_current_component(null)},t=>{if(set_current_component(n),r(e.catch,2,e.error,t),set_current_component(null),!e.hasCatch)throw t}),e.current!==e.pending)return r(e.pending,0),!0}else{if(e.current!==e.then)return r(e.then,1,e.value,t),!0;e.resolved=t}}function update_await_block_branch(t,e,n){const r=e.slice(),{resolved:o}=t;t.current===t.then&&(r[t.value]=o),t.current===t.catch&&(r[t.error]=o),t.block.p(r,n)}const globals="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function outro_and_destroy_block(t,e){transition_out(t,1,1,()=>{e.delete(t.key)})}function update_keyed_each(t,e,n,r,o,i,a,s,c,l,d,u){let h=t.length,m=i.length,f=h;const p={};for(;f--;)p[t[f].key]=f;const _=[],g=new Map,w=new Map;for(f=m;f--;){const t=u(o,i,f),s=n(t);let c=a.get(s);c?r&&c.p(t,e):(c=l(s,t),c.c()),g.set(s,_[f]=c),s in p&&w.set(s,Math.abs(f-p[s]))}const $=new Set,y=new Set;function b(t){transition_in(t,1),t.m(s,d),a.set(t.key,t),d=t.first,m--}for(;h&&m;){const e=_[m-1],n=t[h-1],r=e.key,o=n.key;e===n?(d=e.first,h--,m--):g.has(o)?!a.has(r)||$.has(r)?b(e):y.has(o)?h--:w.get(r)>w.get(o)?(y.add(r),b(e)):($.add(o),h--):(c(n,a),h--)}for(;h--;){const e=t[h];g.has(e.key)||c(e,a)}for(;m;)b(_[m-1]);return _}function bind(t,e,n){const r=t.$$.props[e];void 0!==r&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function create_component(t){t&&t.c()}function mount_component(t,e,n,r){const{fragment:o,on_mount:i,on_destroy:a,after_update:s}=t.$$;o&&o.m(e,n),r||add_render_callback(()=>{const e=i.map(run).filter(is_function);a?a.push(...e):run_all(e),t.$$.on_mount=[]}),s.forEach(add_render_callback)}function destroy_component(t,e){const n=t.$$;null!==n.fragment&&(run_all(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function make_dirty(t,e){-1===t.$$.dirty[0]&&(dirty_components.push(t),schedule_update(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function init(t,e,n,r,o,i,a=[-1]){const s=current_component;set_current_component(t);const c=t.$$={fragment:null,ctx:null,props:i,update:noop,not_equal:o,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:e.context||[]),callbacks:blank_object(),dirty:a,skip_bound:!1};let l=!1;if(c.ctx=n?n(t,e.props||{},(e,n,...r)=>{const i=r.length?r[0]:n;return c.ctx&&o(c.ctx[e],c.ctx[e]=i)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](i),l&&make_dirty(t,e)),n}):[],c.update(),l=!0,run_all(c.before_update),c.fragment=!!r&&r(c.ctx),e.target){if(e.hydrate){const t=children(e.target);c.fragment&&c.fragment.l(t),t.forEach(detach)}else c.fragment&&c.fragment.c();e.intro&&transition_in(t.$$.fragment),mount_component(t,e.target,e.anchor,e.customElement),flush()}set_current_component(s)}class SvelteComponent{$destroy(){destroy_component(this,1),this.$destroy=noop}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!is_empty(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function create_fragment$T(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polygon"),attr(n,"d","M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"),attr(r,"points","12 15 17 21 7 21 12 15"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-airplay "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-airplay "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$T(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class AirplayIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$T,create_fragment$T,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$S(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("line"),o=svg_element("line"),attr(n,"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"),attr(r,"x1","12"),attr(r,"y1","9"),attr(r,"x2","12"),attr(r,"y2","13"),attr(o,"x1","12"),attr(o,"y1","17"),attr(o,"x2","12.01"),attr(o,"y2","17"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-alert-triangle "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-alert-triangle "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$S(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class AlertTriangleIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$S,create_fragment$S,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$R(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("circle"),r=svg_element("polyline"),o=svg_element("line"),attr(n,"cx","12"),attr(n,"cy","12"),attr(n,"r","10"),attr(r,"points","8 12 12 16 16 12"),attr(o,"x1","12"),attr(o,"y1","8"),attr(o,"x2","12"),attr(o,"y2","16"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-arrow-down-circle "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-arrow-down-circle "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$R(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class ArrowDownCircleIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$R,create_fragment$R,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$Q(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("path"),attr(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),attr(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-book-open "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-book-open "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$Q(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class BookOpenIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$Q,create_fragment$Q,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$P(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("circle"),attr(n,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),attr(r,"cx","12"),attr(r,"cy","13"),attr(r,"r","4"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-camera "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-camera "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$P(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CameraIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$P,create_fragment$P,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$O(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),attr(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),attr(r,"points","22 4 12 14.01 9 11.01"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-check-circle "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-check-circle "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$O(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CheckCircleIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$O,create_fragment$O,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$N(t){let e,n,r;return{c(){e=svg_element("svg"),n=svg_element("path"),attr(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",r="feather feather-command "+t[2])},m(t,r){insert(t,e,r),append(e,n)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&r!==(r="feather feather-command "+t[2])&&attr(e,"class",r)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$N(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CommandIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$N,create_fragment$N,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$M(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("polyline"),r=svg_element("path"),attr(n,"points","9 10 4 15 9 20"),attr(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-corner-down-left "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-corner-down-left "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$M(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CornerDownLeftIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$M,create_fragment$M,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$L(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("line"),o=svg_element("line"),attr(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),attr(r,"x1","18"),attr(r,"y1","9"),attr(r,"x2","12"),attr(r,"y2","15"),attr(o,"x1","12"),attr(o,"y1","9"),attr(o,"x2","18"),attr(o,"y2","15"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-delete "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-delete "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$L(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class DeleteIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$L,create_fragment$L,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$K(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),o=svg_element("line"),attr(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),attr(r,"points","15 3 21 3 21 9"),attr(o,"x1","10"),attr(o,"y1","14"),attr(o,"x2","21"),attr(o,"y2","3"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-external-link "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-external-link "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$K(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class ExternalLinkIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$K,create_fragment$K,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$J(t){let e,n,r,o,i,a;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),o=svg_element("line"),i=svg_element("line"),attr(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),attr(r,"points","14 2 14 8 20 8"),attr(o,"x1","12"),attr(o,"y1","18"),attr(o,"x2","12"),attr(o,"y2","12"),attr(i,"x1","9"),attr(i,"y1","15"),attr(i,"x2","15"),attr(i,"y2","15"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",a="feather feather-file-plus "+t[2])},m(t,a){insert(t,e,a),append(e,n),append(e,r),append(e,o),append(e,i)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&a!==(a="feather feather-file-plus "+t[2])&&attr(e,"class",a)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$J(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class FilePlusIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$J,create_fragment$J,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$I(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("circle"),r=svg_element("line"),o=svg_element("path"),attr(n,"cx","12"),attr(n,"cy","12"),attr(n,"r","10"),attr(r,"x1","2"),attr(r,"y1","12"),attr(r,"x2","22"),attr(r,"y2","12"),attr(o,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-globe "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-globe "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$I(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class GlobeIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$I,create_fragment$I,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$H(t){let e,n,r,o,i,a,s,c;return{c(){e=svg_element("svg"),n=svg_element("line"),r=svg_element("line"),o=svg_element("line"),i=svg_element("line"),a=svg_element("line"),s=svg_element("line"),attr(n,"x1","8"),attr(n,"y1","6"),attr(n,"x2","21"),attr(n,"y2","6"),attr(r,"x1","8"),attr(r,"y1","12"),attr(r,"x2","21"),attr(r,"y2","12"),attr(o,"x1","8"),attr(o,"y1","18"),attr(o,"x2","21"),attr(o,"y2","18"),attr(i,"x1","3"),attr(i,"y1","6"),attr(i,"x2","3.01"),attr(i,"y2","6"),attr(a,"x1","3"),attr(a,"y1","12"),attr(a,"x2","3.01"),attr(a,"y2","12"),attr(s,"x1","3"),attr(s,"y1","18"),attr(s,"x2","3.01"),attr(s,"y2","18"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",c="feather feather-list "+t[2])},m(t,c){insert(t,e,c),append(e,n),append(e,r),append(e,o),append(e,i),append(e,a),append(e,s)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&c!==(c="feather feather-list "+t[2])&&attr(e,"class",c)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$H(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class ListIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$H,create_fragment$H,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$G(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),attr(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),attr(r,"points","22,6 12,13 2,6"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-mail "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-mail "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$G(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class MailIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$G,create_fragment$G,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$F(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("circle"),attr(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),attr(r,"cx","12"),attr(r,"cy","10"),attr(r,"r","3"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-map-pin "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-map-pin "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$F(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class MapPinIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$F,create_fragment$F,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$E(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("polyline"),r=svg_element("line"),o=svg_element("path"),attr(n,"points","23 7 23 1 17 1"),attr(r,"x1","16"),attr(r,"y1","8"),attr(r,"x2","23"),attr(r,"y2","1"),attr(o,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-phone-outgoing "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-phone-outgoing "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$E(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class PhoneOutgoingIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$E,create_fragment$E,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$D(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("polyline"),r=svg_element("path"),o=svg_element("rect"),attr(n,"points","6 9 6 2 18 2 18 9"),attr(r,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),attr(o,"x","6"),attr(o,"y","14"),attr(o,"width","12"),attr(o,"height","8"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-printer "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-printer "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$D(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class PrinterIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$D,create_fragment$D,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$C(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("circle"),r=svg_element("line"),attr(n,"cx","11"),attr(n,"cy","11"),attr(n,"r","8"),attr(r,"x1","21"),attr(r,"y1","21"),attr(r,"x2","16.65"),attr(r,"y2","16.65"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-search "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-search "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$C(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class SearchIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$C,create_fragment$C,safe_not_equal,{size:0,strokeWidth:1,class:2})}}const{document:document_1$g}=globals;function add_css$x(){var t=element("style");t.id="svelte-47aais-style",t.textContent=".feather.svelte-47aais.svelte-47aais{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-47aais.svelte-47aais{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-47aais .editRow.svelte-47aais{width:1em}.eList.svelte-47aais table.svelte-47aais{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-47aais table thead.svelte-47aais{position:sticky;top:0;background:#326173;color:white}.eList.svelte-47aais table thead tr.svelte-47aais{height:2.3em}.eList.svelte-47aais table tbody tr.svelte-47aais{height:2.75em !important}th.svelte-47aais.svelte-47aais,td.svelte-47aais.svelte-47aais{padding-left:0.4em;padding-right:0.4em}td.number.svelte-47aais.svelte-47aais{text-align:end}tr.pointer.svelte-47aais.svelte-47aais:hover{background-color:#DAE1E5}tr.active.svelte-47aais.svelte-47aais{color:#326173;background-color:#fcebd5}tr.blocked.svelte-47aais.svelte-47aais{color:red !important}tr.undeliverable.svelte-47aais.svelte-47aais{color:orange}",append(document_1$g.head,t)}function get_then_context$4(t){t[49]=t[50].items}function get_each_context$e(t,e,n){const r=t.slice();return r[51]=e[n],r[53]=n,r}function get_each_context_1$9(t,e,n){const r=t.slice();return r[54]=e[n],r}function get_each_context_2$6(t,e,n){const r=t.slice();return r[54]=e[n],r}function create_catch_block$d(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$d(t){let e,n,r,o,i,a;get_then_context$4(t);let s=t[5]?.length&&create_if_block_5$7(t),c=t[49]?.length&&create_if_block_3$8(t),l=t[5]?.length&&create_if_block$x(t);return{c(){s&&s.c(),e=space(),n=element("div"),r=element("table"),c&&c.c(),o=space(),i=element("tbody"),l&&l.c(),attr(r,"striped",""),attr(r,"class","svelte-47aais"),attr(n,"class","eList svelte-47aais")},m(t,d){s&&s.m(t,d),insert(t,e,d),insert(t,n,d),append(n,r),c&&c.m(r,null),append(r,o),append(r,i),l&&l.m(i,null),a=!0},p(t,n){get_then_context$4(t),t[5]?.length?s?(s.p(t,n),32&n[0]&&transition_in(s,1)):(s=create_if_block_5$7(t),s.c(),transition_in(s,1),s.m(e.parentNode,e)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),t[49]?.length?c?c.p(t,n):(c=create_if_block_3$8(t),c.c(),c.m(r,o)):c&&(c.d(1),c=null),t[5]?.length?l?(l.p(t,n),32&n[0]&&transition_in(l,1)):(l=create_if_block$x(t),l.c(),transition_in(l,1),l.m(i,null)):l&&(group_outros(),transition_out(l,1,1,()=>{l=null}),check_outros())},i(t){a||(transition_in(s),transition_in(l),a=!0)},o(t){transition_out(s),transition_out(l),a=!1},d(t){s&&s.d(t),t&&detach(e),t&&detach(n),c&&c.d(),l&&l.d()}}}function create_if_block_5$7(t){let e,n,r,o,i,a,s,c,l,d,u,h=t[6]&&create_if_block_6$5(t);function m(e){t[33](e)}let f={id:t[10]};return void 0!==t[3]&&(f.value=t[3]),o=new t[8]({props:f}),binding_callbacks.push(()=>bind(o,"value",m)),o.$on("input",t[14]),c=new DeleteIcon({props:{size:"18"}}),{c(){h&&h.c(),e=space(),n=element("div"),r=text("Suchen: "),create_component(o.$$.fragment),a=space(),s=element("span"),create_component(c.$$.fragment),attr(s,"class","feather pointer svelte-47aais"),set_style(n,"margin-bottom","1em"),set_style(n,"position","relative")},m(i,m){h&&h.m(i,m),insert(i,e,m),insert(i,n,m),append(n,r),mount_component(o,n,null),append(n,a),append(n,s),mount_component(c,s,null),l=!0,d||(u=listen(s,"click",t[16]),d=!0)},p(t,n){t[6]?h?64&n[0]&&transition_in(h,1):(h=create_if_block_6$5(t),h.c(),transition_in(h,1),h.m(e.parentNode,e)):h&&(group_outros(),transition_out(h,1,1,()=>{h=null}),check_outros());const r={};!i&&8&n[0]&&(i=!0,r.value=t[3],add_flush_callback(()=>i=!1)),o.$set(r)},i(t){l||(transition_in(h),transition_in(o.$$.fragment,t),transition_in(c.$$.fragment,t),l=!0)},o(t){transition_out(h),transition_out(o.$$.fragment,t),transition_out(c.$$.fragment,t),l=!1},d(t){h&&h.d(t),t&&detach(e),t&&detach(n),destroy_component(o),destroy_component(c),d=!1,u()}}}function create_if_block_6$5(t){let e,n;return e=new t[7]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_3$8(t){let e,n,r,o=t[4]&&t[0]&&create_if_block_4$8(),i=t[49],a=[];for(let e=0;e<i.length;e+=1)a[e]=create_each_block_2$6(get_each_context_2$6(t,i,e));return{c(){e=element("thead"),n=element("tr"),o&&o.c(),r=space();for(let t=0;t<a.length;t+=1)a[t].c();attr(n,"class","svelte-47aais"),attr(e,"class","svelte-47aais")},m(t,i){insert(t,e,i),append(e,n),o&&o.m(n,null),append(n,r);for(let t=0;t<a.length;t+=1)a[t].m(n,null)},p(t,e){if(t[4]&&t[0]?o||(o=create_if_block_4$8(),o.c(),o.m(n,r)):o&&(o.d(1),o=null),8196&e[0]){let r;for(i=t[49],r=0;r<i.length;r+=1){const o=get_each_context_2$6(t,i,r);a[r]?a[r].p(o,e):(a[r]=create_each_block_2$6(o),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=i.length}},d(t){t&&detach(e),o&&o.d(),destroy_each(a,t)}}}function create_if_block_4$8(t){let e;return{c(){e=element("th"),attr(e,"class","svelte-47aais")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_each_block_2$6(t){let e,n,r=t[54]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-47aais")},m(t,r){insert(t,e,r),append(e,n)},p(t,e){4&e[0]&&r!==(r=t[54]?.designation+"")&&set_data(n,r)},d(t){t&&detach(e)}}}function create_if_block$x(t){let e,n,r=[],o=new Map,i=t[5];const a=t=>t[51]?._id;for(let e=0;e<i.length;e+=1){let n=get_each_context$e(t,i,e),s=a(n);o.set(s,r[e]=create_each_block$e(s,n))}return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,o){for(let e=0;e<r.length;e+=1)r[e].m(t,o);insert(t,e,o),n=!0},p(t,n){178239&n[0]&&(i=t[5],group_outros(),r=update_keyed_each(r,n,a,1,t,i,o,e.parentNode,outro_and_destroy_block,create_each_block$e,e,get_each_context$e),check_outros())},i(t){if(!n){for(let t=0;t<i.length;t+=1)transition_in(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)transition_out(r[t]);n=!1},d(t){for(let e=0;e<r.length;e+=1)r[e].d(t);t&&detach(e)}}}function create_if_block_1$l(t){let e,n,r,o,i,a,s=t[4]&&t[0]&&create_if_block_2$d(t),c=t[49],l=[];for(let e=0;e<c.length;e+=1)l[e]=create_each_block_1$9(get_each_context_1$9(t,c,e));return{c(){e=element("tr"),s&&s.c(),n=space();for(let t=0;t<l.length;t+=1)l[t].c();r=space(),attr(e,"class","pointer svelte-47aais"),toggle_class(e,"active",t[51]._id===t[1]),toggle_class(e,"blocked",!!t[51].blocked),toggle_class(e,"undeliverable",!!t[51].undeliverable)},m(c,d){insert(c,e,d),s&&s.m(e,null),append(e,n);for(let t=0;t<l.length;t+=1)l[t].m(e,null);append(e,r),o=!0,i||(a=listen(e,"click",stop_propagation(function(){is_function(t[12](t[51],t[53]))&&t[12](t[51],t[53]).apply(this,arguments)})),i=!0)},p(o,i){if((t=o)[4]&&t[0]?s?(s.p(t,i),17&i[0]&&transition_in(s,1)):(s=create_if_block_2$d(t),s.c(),transition_in(s,1),s.m(e,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),10276&i[0]){let n;for(c=t[49],n=0;n<c.length;n+=1){const o=get_each_context_1$9(t,c,n);l[n]?l[n].p(o,i):(l[n]=create_each_block_1$9(o),l[n].c(),l[n].m(e,r))}for(;n<l.length;n+=1)l[n].d(1);l.length=c.length}34&i[0]&&toggle_class(e,"active",t[51]._id===t[1]),32&i[0]&&toggle_class(e,"blocked",!!t[51].blocked),32&i[0]&&toggle_class(e,"undeliverable",!!t[51].undeliverable)},i(t){o||(transition_in(s),o=!0)},o(t){transition_out(s),o=!1},d(t){t&&detach(e),s&&s.d(),destroy_each(l,t),i=!1,a()}}}function create_if_block_2$d(t){let e,n,r,o,i;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("td"),create_component(n.$$.fragment),attr(e,"class","editRow svelte-47aais"),set_style(e,"color","#326173")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",stop_propagation(function(){is_function(t[17](t[51]))&&t[17](t[51]).apply(this,arguments)})),o=!0)},p(e,n){t=e},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block_1$9(t){let e,n,r,o=t[11](t[51],t[54])+"";return{c(){e=element("td"),n=text(o),attr(e,"class",r=null_to_empty(t[54].type)+" svelte-47aais")},m(t,r){insert(t,e,r),append(e,n)},p(t,i){36&i[0]&&o!==(o=t[11](t[51],t[54])+"")&&set_data(n,o),4&i[0]&&r!==(r=null_to_empty(t[54].type)+" svelte-47aais")&&attr(e,"class",r)},d(t){t&&detach(e)}}}function create_each_block$e(t,e){let n,r,o,i=e[15](e[51],e[49],e[3]),a=i&&create_if_block_1$l(e);return{key:t,first:null,c(){n=empty(),a&&a.c(),r=empty(),this.first=n},m(t,e){insert(t,n,e),a&&a.m(t,e),insert(t,r,e),o=!0},p(t,n){e=t,44&n[0]&&(i=e[15](e[51],e[49],e[3])),i?a?(a.p(e,n),44&n[0]&&transition_in(a,1)):(a=create_if_block_1$l(e),a.c(),transition_in(a,1),a.m(r.parentNode,r)):a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros())},i(t){o||(transition_in(a),o=!0)},o(t){transition_out(a),o=!1},d(t){t&&detach(n),a&&a.d(t),t&&detach(r)}}}function create_pending_block$d(t){let e,n;return e=new t[7]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$B(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$d,then:create_then_block$d,catch:create_catch_block$d,value:50,blocks:[,,,]};return handle_promise(n=t[2]&&t[13](),o),{c(){e=empty(),o.block.c()},m(t,n){insert(t,e,n),o.block.m(t,o.anchor=n),o.mount=()=>e.parentNode,o.anchor=e,r=!0},p(e,r){t=e,o.ctx=t,4&r[0]&&n!==(n=t[2]&&t[13]())&&handle_promise(n,o)||update_await_block_branch(o,t,r)},i(t){r||(transition_in(o.block),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}r=!1},d(t){t&&detach(e),o.block.d(t),o.token=null,o=null}}}const getDisplayItems=exports("getDisplayItems",async(t,e,n)=>{if(!t)return;let r=[];for(const o of t){if("_total"===o){r.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){r.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[t,i]=o.split(".");let a=e.list?.find(e=>e.name===t)?.item?.find(t=>t.name===i);if(a&&(a={...a},a.name=`${t}_${i}`,n=n.map(e=>(e[t]&&(e[a.name]=e["_"+t]?e["_"+t][i]:e[t][i]),e))),a||(a=e.items.find(e=>e.name===t)),!a){const e=(await Request.getSchemaByClass(t)).items.find(t=>t.name===i);e&&(a={name:t,designation:e.designation,type:e.type,decimals:e.properties?.decimals||0})}r.find(e=>e?.name===t)||r.push(a)}return r.length?r:e.items});function instance$B(t,e,n){let r;let o=JSON.parse(Storage.getItem("Locale")).id;const i=createEventDispatcher(),{Loading:a,TextField:s}=getAttractions,{currentTasks:c}=user;component_subscribe(t,c,t=>n(37,r=t));let l,d,u,h,{inputList:m}=e,{eventId:f}=e,{prevEventId:p}=e,{record:_}=e,{className:g}=e,{rowId:w}=e,{filterForReady:$=!1}=e,{filter:y}=e,{query:b}=e,{refStatus:v}=e,{showEdit:I=!1}=e,{praefix:C=""}=e,{selectionFields:E=!1}=e,{deList:A}=e,{stopAggregation:S=!1}=e,{shouldBlock:k}=e,{inputSearch:T=""}=e,R=!0,N=T,D=g+Math.floor(9e3*Math.random()+1e3).toString()+"search",x=!1,O=!0;const M=(t,e)=>{if(!e)return;let n=t[e.name];if("__total"===e.name&&void 0===n&&(n=1.081*t._total),!n&&e.name.includes("_")&&!e.name.startsWith("_")){const[r,o]=e.name.split("_");try{n=t[r][o]}catch{}}if(Array.isArray(n)){const t=t=>t.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let e=[];for(const r of n)e=e.concat(r.serialno.map(t));n=e.join(", ")}else n=n.map(t),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&e.name.split("_").length>1){const[r,o]=e.name.split("_");try{n=t[r][0][o],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===e.type&&(n||(n=t[`_${e.name}`]),n=Number(n)?Number(n).toLocaleString(o,{minimumFractionDigits:e.properties?.decimals||e.decimals||0,maximumFractionDigits:e.properties?.decimals||e.decimals||0}):""),"boolean"===e.type&&"Aktiv"===n&&(n=!1),"number"===e.type?n:"boolean"==typeof n||"boolean"===e.type?checkBoolean(n):checkDate(t[`_${e.name}`]||n||"")},P=Request.getSchemaByClass(g),B=async(t,e)=>{if(!t)return[];if(y){let e;const n=y.startsWith("!");n&&(e=y.replace("!",""));const r=y.startsWith("$");if(e&&!r&&(t=t.filter(t=>r?t[e]===w:n?!t[e]:!!t[e])),r){e=y.replace("$","");const[n,r]=e.split(".");if(_[r]){const e=await Request.getSectionView(n,{[r]:_[r]});t=t.filter(t=>e.find(e=>e._id==t[n]))}else t=[]}}if(v&&!b)return n(18,v=[].concat(v)),t.filter(t=>!!v.find(e=>t._task.status===e));if("Information"===e.state.task)return t;if(p){const e=await Request.getEvent(p);if("report"===e?.output?.type)return t;if(e?.input?.class?.length&&e.input.class[0].name===g)return"Information"===e.state.task?t.filter(t=>"Closed"!==t._task.status):t.filter(t=>"Ready"===t._task.status)}return t.filter(t=>"WaitingForApproval"===t._task.status||"Ready"===t._task.status||"Closing"===t._task.status)},F=(t,e)=>{if(t){let n,r="1";if("string"==typeof t)n=t;else{const e=Object.keys(t);n=e[0],r=e[1]}"date"===n&&(r="-1");const i=new Intl.Collator(o,{numeric:!0});return 1==r?e.sort((t,e)=>i.compare(t[n],e[n])):e.sort((t,e)=>i.compare(e[n],t[n]))}return e},L=async t=>{let e,r=0;O=!1;const o=t=>new Promise(e=>setTimeout(e,t)),i=await P;for(;r++<200&&!S&&!(e=await q(t,i.id));)await o(500);n(6,x=!1),S&&Request.readTasksByAggregationId(t,!0),e&&(n(5,u=F(d.displaySort,e.data)),window.setTimeout(()=>{const t=document.querySelector("tr.active");t&&t.scrollIntoView({block:"end",behavior:"smooth"}),O=!0},100))},q=async(t,e)=>await Request.readTasksByAggregationId(t,!1,e),V=async(t,e,n,r)=>{const{value:o,refClass:i}=r,[a,s]=n.split("."),c=o?.get(C),l=c&&await getTaskFull(a,c);if(!l)return t;const d=l[s];return d?.length?d.map(n=>{let r=t?.find(t=>t._id===n[e])||{};r={...r};for(const t in r)n[t]&&(r[t]=n[t]);for(const t in n)n[t]&&(r[t]=n[t]);return setTaskSelection(i+r._id.toString(),r),r}):t};onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(D)?.focus()},200)}),task_notification.subscribe(async t=>{if(!t)return;const e=await P;t.eventId===e.id&&(refreshList(e.class,t.eventId),n(2,R=!n(2,R=!1)))});return t.$$set=t=>{"inputList"in t&&n(20,m=t.inputList),"eventId"in t&&n(21,f=t.eventId),"prevEventId"in t&&n(22,p=t.prevEventId),"record"in t&&n(23,_=t.record),"className"in t&&n(24,g=t.className),"rowId"in t&&n(1,w=t.rowId),"filterForReady"in t&&n(25,$=t.filterForReady),"filter"in t&&n(26,y=t.filter),"query"in t&&n(27,b=t.query),"refStatus"in t&&n(18,v=t.refStatus),"showEdit"in t&&n(0,I=t.showEdit),"praefix"in t&&n(28,C=t.praefix),"selectionFields"in t&&n(29,E=t.selectionFields),"deList"in t&&n(30,A=t.deList),"stopAggregation"in t&&n(19,S=t.stopAggregation),"shouldBlock"in t&&n(31,k=t.shouldBlock),"inputSearch"in t&&n(32,T=t.inputSearch)},[I,w,R,N,l,u,x,a,s,c,D,M,(t,e)=>r=>{n(19,S=!0);const o=O?t:h[e];i("choose",{row:o})},async()=>{d=await P,n(4,l=(t=>!r?.length||!!r.find(e=>e===t))(d.id)),b&&n(5,u=h=await Request.getTasksFiltered(d.class,b)),u||n(5,u=h=F(d.displaySort,await m||await getList(d.class,d.id))),500!==u?.length||b||(n(6,x=!0),Request.getTasksList(d.id,!1,!0).then(({aggregationId:t})=>L(t)));let t,e=!1,o="";const a=E&&E?.find(t=>d.class===t.refClass.split(":")[0]),s=a?.value?.get&&a.value.get(C);if(s){const[r,i]=a.refClass.split(":");d.class===r&&n(5,u=await V(u,r,i,a)),e=a.parentClass?.find(t=>"quantity"===t.name),o=a.className,t=await Request.getCountedSection(o,i.split(".")[0],s,r,"quantity")}n(0,I&&=!a),!a&&(y||$||v)&&n(5,u=await B(u,d));const{display:c}=d;let f=await getDisplayItems(c,d,u);return!I&&e?(f=f.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),n(5,u=u.map(e=>{const n=t.find(t=>t._id===e._id);return n&&(e.ist=n.quantity.$numberDecimal),e})),t.map(t=>{if(!u.find(e=>e._id===t._id)){const e=h.find(e=>e._id===t._id);e&&(e.ist=t.quantity.$numberDecimal),u.push(e)}}),i("init",u)):A&&n(5,u=u.filter(t=>!A.find(e=>e?._id===t._id))),k&&n(5,u=u.filter(t=>!t[k])),{items:f}},({detail:{value:t}})=>{n(3,N=t)},(t,e,n)=>{if(!t)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const o of e){const e=M(t,o).toLowerCase();!r&&e.includes(n)&&(r=!0)}return r},()=>{n(3,N="")},async t=>{let e=t._task;e||(e=await getTask(g,"",t._id,!0),e=e._task),window.open(`/task/${e.event}/${e.task_id||e._id}/task?view=standalone`,"_blank")},v,S,m,f,p,_,g,$,y,b,C,E,A,k,T,function(t){N=t,n(3,N)}]}class List$1 extends SvelteComponent{constructor(t){super(),document_1$g.getElementById("svelte-47aais-style")||add_css$x(),init(this,t,instance$B,create_fragment$B,safe_not_equal,{inputList:20,eventId:21,prevEventId:22,record:23,className:24,rowId:1,filterForReady:25,filter:26,query:27,refStatus:18,showEdit:0,praefix:28,selectionFields:29,deList:30,stopAggregation:19,shouldBlock:31,inputSearch:32},[-1,-1])}}function add_css$w(){var t=element("style");t.id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",append(document.head,t)}function create_catch_block$c(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$c(t){let e,n,r=t[45]&&create_if_block$w(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[45]?r?(r.p(t,n),16&n[0]&&transition_in(r,1)):(r=create_if_block$w(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block$w(t){let e,n;return e=new t[25]({props:{title:t[20]?"Auswahl":t[0],class:"eList "+(t[18]?"form":""),$$slots:{default:[create_default_slot$i]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1048577&n[0]&&(r.title=t[20]?"Auswahl":t[0]),262144&n[0]&&(r.class="eList "+(t[18]?"form":"")),33554430&n[0]|32768&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_else_block_1$5(t){let e,n;return e=new Index({props:{schema:t[2],recID:t[1],readonly:t[19]}}),e.$on("choose",function(){is_function(t[34](t[45]))&&t[34](t[45]).apply(this,arguments)}),e.$on("back",t[31]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};4&r[0]&&(o.schema=t[2]),2&r[0]&&(o.recID=t[1]),524288&r[0]&&(o.readonly=t[19]),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_1$k(t){let e,n,r,o,i,a,s;e=new t[26]({props:{text:t[20]?"Zusätzliche Auswahl":""}});const c=[create_if_block_2$c,create_else_block$g],l=[];function d(t,e){return t[20]?0:1}return r=d(t),o=l[r]=c[r](t),a=new List$1({props:{inputSearch:t[15],record:t[3],eventId:t[2].id,className:t[2].class,prevEventId:t[14],filterForReady:t[5],filter:t[6],query:t[7],refStatus:t[8],praefix:t[9],selectionFields:t[10],rowId:t[1],shouldBlock:t[16],deList:t[12],stopAggregation:t[24],showEdit:t[11]}}),a.$on("edit",t[35]),a.$on("choose",t[38]),a.$on("init",t[36]),{c(){create_component(e.$$.fragment),n=space(),o.c(),i=space(),create_component(a.$$.fragment)},m(t,o){mount_component(e,t,o),insert(t,n,o),l[r].m(t,o),insert(t,i,o),mount_component(a,t,o),s=!0},p(t,n){const s={};1048576&n[0]&&(s.text=t[20]?"Zusätzliche Auswahl":""),e.$set(s);let u=r;r=d(t),r===u?l[r].p(t,n):(group_outros(),transition_out(l[u],1,1,()=>{l[u]=null}),check_outros(),o=l[r],o?o.p(t,n):(o=l[r]=c[r](t),o.c()),transition_in(o,1),o.m(i.parentNode,i));const h={};32768&n[0]&&(h.inputSearch=t[15]),8&n[0]&&(h.record=t[3]),4&n[0]&&(h.eventId=t[2].id),4&n[0]&&(h.className=t[2].class),16384&n[0]&&(h.prevEventId=t[14]),32&n[0]&&(h.filterForReady=t[5]),64&n[0]&&(h.filter=t[6]),128&n[0]&&(h.query=t[7]),256&n[0]&&(h.refStatus=t[8]),512&n[0]&&(h.praefix=t[9]),1024&n[0]&&(h.selectionFields=t[10]),2&n[0]&&(h.rowId=t[1]),65536&n[0]&&(h.shouldBlock=t[16]),4096&n[0]&&(h.deList=t[12]),16777216&n[0]&&(h.stopAggregation=t[24]),2048&n[0]&&(h.showEdit=t[11]),a.$set(h)},i(t){s||(transition_in(e.$$.fragment,t),transition_in(o),transition_in(a.$$.fragment,t),s=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(o),transition_out(a.$$.fragment,t),s=!1},d(t){destroy_component(e,t),t&&detach(n),l[r].d(t),t&&detach(i),destroy_component(a,t)}}}function create_else_block$g(t){let e,n,r,o;n=new t[27]({props:{outline:!0,$$slots:{default:[create_default_slot_3$3]},$$scope:{ctx:t}}}),n.$on("click",t[32]);let i=t[29]&&t[13]&&create_if_block_4$7(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i&&i.c(),attr(e,"class","form--buttons svelte-jb5mrh")},m(t,a){insert(t,e,a),mount_component(n,e,null),append(e,r),i&&i.m(e,null),o=!0},p(t,r){const o={};32768&r[1]&&(o.$$scope={dirty:r,ctx:t}),n.$set(o),t[29]&&t[13]?i?(i.p(t,r),8192&r[0]&&transition_in(i,1)):(i=create_if_block_4$7(t),i.c(),transition_in(i,1),i.m(e,null)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){o||(transition_in(n.$$.fragment,t),transition_in(i),o=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),o=!1},d(t){t&&detach(e),destroy_component(n),i&&i.d()}}}function create_if_block_2$c(t){let e,n,r,o,i,a,s=t[23]&&create_if_block_3$7(t);return r=new t[27]({props:{outline:!0,$$slots:{default:[create_default_slot_1$d]},$$scope:{ctx:t}}}),r.$on("click",t[32]),i=new t[26]({props:{text:"Liste aus "+t[17]}}),{c(){s&&s.c(),e=space(),n=element("div"),create_component(r.$$.fragment),o=space(),create_component(i.$$.fragment),attr(n,"class","form--buttons svelte-jb5mrh")},m(t,c){s&&s.m(t,c),insert(t,e,c),insert(t,n,c),mount_component(r,n,null),insert(t,o,c),mount_component(i,t,c),a=!0},p(t,n){t[23]?s?(s.p(t,n),8388608&n[0]&&transition_in(s,1)):(s=create_if_block_3$7(t),s.c(),transition_in(s,1),s.m(e.parentNode,e)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros());const o={};32768&n[1]&&(o.$$scope={dirty:n,ctx:t}),r.$set(o);const a={};131072&n[0]&&(a.text="Liste aus "+t[17]),i.$set(a)},i(t){a||(transition_in(s),transition_in(r.$$.fragment,t),transition_in(i.$$.fragment,t),a=!0)},o(t){transition_out(s),transition_out(r.$$.fragment,t),transition_out(i.$$.fragment,t),a=!1},d(t){s&&s.d(t),t&&detach(e),t&&detach(n),destroy_component(r),t&&detach(o),destroy_component(i,t)}}}function create_default_slot_3$3(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_4$7(t){let e,n;return e=new t[27]({props:{filled:!0,$$slots:{default:[create_default_slot_2$8]},$$scope:{ctx:t}}}),e.$on("click",t[33]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};32768&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$8(t){let e;return{c(){e=text("Neu")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_3$7(t){let e,n;return e=new InputFormField({props:{item:t[21],record:{_id:"",[t[21].name]:""},noForm:"true",classId:"sel_"+t[21].name,eventId:t[22],required:!1,hidden:!1,readonly:!1,deList:t[23]}}),e.$on("notify",t[37]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2097152&n[0]&&(r.item=t[21]),2097152&n[0]&&(r.record={_id:"",[t[21].name]:""}),2097152&n[0]&&(r.classId="sel_"+t[21].name),4194304&n[0]&&(r.eventId=t[22]),8388608&n[0]&&(r.deList=t[23]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$d(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot$i(t){let e,n,r,o;const i=[create_if_block_1$k,create_else_block_1$5],a=[];function s(t,e){return t[45].length&&!t[18]?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_pending_block$c(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$A(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$c,then:create_then_block$c,catch:create_catch_block$c,value:45,blocks:[,,,]};return handle_promise(n=t[30](t[4]),o),{c(){e=empty(),o.block.c()},m(t,n){insert(t,e,n),o.block.m(t,o.anchor=n),o.mount=()=>e.parentNode,o.anchor=e,r=!0},p(e,r){t=e,o.ctx=t,16&r[0]&&n!==(n=t[30](t[4]))&&handle_promise(n,o)||update_await_block_branch(o,t,r)},i(t){r||(transition_in(o.block),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}r=!1},d(t){t&&detach(e),o.block.d(t),o.token=null,o=null}}}function instance$A(t,e,n){let r;const{Dialog:o,Divider:i,Button:a}=getAttractions,s=createEventDispatcher(),{currentTasks:c}=user;component_subscribe(t,c,t=>n(41,r=t));let{title:l}=e,{schema:d}=e,{record:u}=e,{recID:h}=e,{isOpening:m=!0}=e,{filterForReady:f=!1}=e,{filter:p}=e,{query:_}=e,{refStatus:g}=e,{praefix:w=""}=e,{selectionFields:$=!1}=e,{showEdit:y=!0}=e,{deList:b}=e,{newAllowed:v=!0}=e,{prevEventId:I}=e,{inputSearch:C}=e,{shouldBlock:E}=e,A=d.id;d.class;let S,k,T,R,N,D,x,O="",M=!1,P=!1;l??=d.identity.designation;const B=!r?.length||r.find(t=>t===A);return t.$$set=t=>{"title"in t&&n(0,l=t.title),"schema"in t&&n(2,d=t.schema),"record"in t&&n(3,u=t.record),"recID"in t&&n(1,h=t.recID),"isOpening"in t&&n(4,m=t.isOpening),"filterForReady"in t&&n(5,f=t.filterForReady),"filter"in t&&n(6,p=t.filter),"query"in t&&n(7,_=t.query),"refStatus"in t&&n(8,g=t.refStatus),"praefix"in t&&n(9,w=t.praefix),"selectionFields"in t&&n(10,$=t.selectionFields),"showEdit"in t&&n(11,y=t.showEdit),"deList"in t&&n(12,b=t.deList),"newAllowed"in t&&n(13,v=t.newAllowed),"prevEventId"in t&&n(14,I=t.prevEventId),"inputSearch"in t&&n(15,C=t.inputSearch),"shouldBlock"in t&&n(16,E=t.shouldBlock)},[l,h,d,u,m,f,p,_,g,w,$,y,b,v,I,C,E,O,M,S,T,N,D,x,P,o,i,a,c,B,async t=>{if(!t)return!1;const e=await getList(d.class,d.id);if(k=$&&$?.find(t=>d.class===t.refClass.split(":")[0]),n(20,T=k?.value?.get&&k.value.get(w)),T){R=k.refClass;const[t,e]=R.split(":"),[r]=e.split(".");n(21,N=k.parentClass.find(e=>e.name===t));const o=await Request.getSchemaByClass(N.refClass);n(22,D=o.id),n(17,O=k.parentClass.find(t=>t.name===r).designation)}return e},()=>{n(18,M=!1),h||s("back"),y||s("back")},()=>{n(24,P=!0),n(18,M=!1),s("back")},()=>{n(24,P=!0),n(1,h=!1),n(19,S=!1),n(18,M=!0)},t=>({detail:{row:t}})=>{let e=d.display;e&&e.length&&e.map(e=>{const[n,r]=e.split(".");let o=d.list?.find(t=>t.name===n)?.item.find(t=>t.name===r);if(o){t[`${n}_${r}`]=t[n][r]}}),s("choose",{row:t})},({detail:t})=>{n(19,S=!!t._task.visum||"Closed"===t._task.status),n(1,h=t._docId),n(18,M=!0)},({detail:t})=>{T&&n(23,x=t)},({detail:t})=>{if(!t.value)return;const e={_id:t.value};s("choose",{row:e})},function(e){bubble(t,e)}]}class FormList extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-jb5mrh-style")||add_css$w(),init(this,t,instance$A,create_fragment$A,safe_not_equal,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,praefix:9,selectionFields:10,showEdit:11,deList:12,newAllowed:13,prevEventId:14,inputSearch:15,shouldBlock:16},[-1,-1])}}const{document:document_1$f}=globals;function add_css$v(){var t=element("style");t.id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",append(document_1$f.head,t)}function get_then_context$3(t){t[28]=t[30].list,t[29]=t[30].items}function get_each_context$d(t,e,n){const r=t.slice();return r[31]=e[n],r}function get_each_context_1$8(t,e,n){const r=t.slice();return r[34]=e[n],r}function get_each_context_2$5(t,e,n){const r=t.slice();return r[34]=e[n],r}function create_catch_block$b(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$b(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w;function $(e){t[25](e)}get_then_context$3(t),n=new t[7]({props:{outline:!0,$$slots:{default:[create_default_slot_1$c]},$$scope:{ctx:t}}}),n.$on("click",t[24]);let y={id:t[8]};void 0!==t[1]&&(y.value=t[1]),a=new t[6]({props:y}),binding_callbacks.push(()=>bind(a,"value",$)),a.$on("input",t[12]),d=new DeleteIcon({props:{size:"18"}});let b=t[29]?.length&&create_if_block_2$b(t),v=t[28]?.length&&create_if_block$v(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),o=element("div"),i=text("Suchen: "),create_component(a.$$.fragment),c=space(),l=element("span"),create_component(d.$$.fragment),u=space(),h=element("div"),m=element("table"),b&&b.c(),f=space(),p=element("tbody"),v&&v.c(),attr(e,"class","form--buttons svelte-14hcfjl"),attr(l,"class","feather pointer svelte-14hcfjl"),set_style(o,"margin-bottom","1em"),set_style(o,"position","relative"),attr(m,"striped",""),attr(m,"class","svelte-14hcfjl"),attr(h,"class","eList svelte-14hcfjl")},m(s,$){insert(s,e,$),mount_component(n,e,null),insert(s,r,$),insert(s,o,$),append(o,i),mount_component(a,o,null),append(o,c),append(o,l),mount_component(d,l,null),insert(s,u,$),insert(s,h,$),append(h,m),b&&b.m(m,null),append(m,f),append(m,p),v&&v.m(p,null),_=!0,g||(w=listen(l,"click",t[14]),g=!0)},p(t,e){get_then_context$3(t);const r={};256&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const o={};!s&&2&e[0]&&(s=!0,o.value=t[1],add_flush_callback(()=>s=!1)),a.$set(o),t[29]?.length&&b.p(t,e),t[28]?.length&&v.p(t,e)},i(t){_||(transition_in(n.$$.fragment,t),transition_in(a.$$.fragment,t),transition_in(d.$$.fragment,t),transition_in(v),_=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a.$$.fragment,t),transition_out(d.$$.fragment,t),transition_out(v),_=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),t&&detach(o),destroy_component(a),destroy_component(d),t&&detach(u),t&&detach(h),b&&b.d(),v&&v.d(),g=!1,w()}}}function create_default_slot_1$c(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_2$b(t){let e,n,r,o,i=t[29],a=[];for(let e=0;e<i.length;e+=1)a[e]=create_each_block_2$5(get_each_context_2$5(t,i,e));return{c(){e=element("thead"),n=element("tr"),r=element("th"),o=space();for(let t=0;t<a.length;t+=1)a[t].c();attr(r,"class","svelte-14hcfjl"),attr(n,"class","svelte-14hcfjl"),attr(e,"class","svelte-14hcfjl")},m(t,i){insert(t,e,i),append(e,n),append(n,r),append(n,o);for(let t=0;t<a.length;t+=1)a[t].m(n,null)},p(t,e){if(2048&e[0]){let r;for(i=t[29],r=0;r<i.length;r+=1){const o=get_each_context_2$5(t,i,r);a[r]?a[r].p(o,e):(a[r]=create_each_block_2$5(o),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=i.length}},d(t){t&&detach(e),destroy_each(a,t)}}}function create_each_block_2$5(t){let e,n,r=t[34]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$v(t){let e,n,r=t[28],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$d(get_each_context$d(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(44547&n[0]){let a;for(r=t[28],a=0;a<r.length;a+=1){const i=get_each_context$d(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$d(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block_1$j(t){let e,n,r,o,i,a,s,c;r=new ExternalLinkIcon({props:{size:"18"}});let l=t[29],d=[];for(let e=0;e<l.length;e+=1)d[e]=create_each_block_1$8(get_each_context_1$8(t,l,e));return{c(){e=element("tr"),n=element("td"),create_component(r.$$.fragment),o=space();for(let t=0;t<d.length;t+=1)d[t].c();i=space(),attr(n,"class","editRow svelte-14hcfjl"),attr(e,"class","pointer svelte-14hcfjl"),toggle_class(e,"active",t[31]._id===t[0])},m(l,u){insert(l,e,u),append(e,n),mount_component(r,n,null),append(e,o);for(let t=0;t<d.length;t+=1)d[t].m(e,null);append(e,i),a=!0,s||(c=listen(n,"click",t[15](t[31])),s=!0)},p(n,r){if(t=n,3584&r[0]){let n;for(l=t[29],n=0;n<l.length;n+=1){const o=get_each_context_1$8(t,l,n);d[n]?d[n].p(o,r):(d[n]=create_each_block_1$8(o),d[n].c(),d[n].m(e,i))}for(;n<d.length;n+=1)d[n].d(1);d.length=l.length}2049&r[0]&&toggle_class(e,"active",t[31]._id===t[0])},i(t){a||(transition_in(r.$$.fragment,t),a=!0)},o(t){transition_out(r.$$.fragment,t),a=!1},d(t){t&&detach(e),destroy_component(r),destroy_each(d,t),s=!1,c()}}}function create_each_block_1$8(t){let e,n,r,o,i=t[9](t[31],t[34])+"";return{c(){e=element("td"),n=text(i),attr(e,"class","svelte-14hcfjl")},m(i,a){insert(i,e,a),append(e,n),r||(o=listen(e,"click",stop_propagation(t[10](t[31]))),r=!0)},p(e,n){t=e},d(t){t&&detach(e),r=!1,o()}}}function create_each_block$d(t){let e,n,r=t[13](t[31],t[29],t[1]),o=r&&create_if_block_1$j(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){2&n[0]&&(r=t[13](t[31],t[29],t[1])),r?o?(o.p(t,n),2&n[0]&&transition_in(o,1)):(o=create_if_block_1$j(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_pending_block$b(t){let e,n;return e=new t[5]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$h(t){let e,n,r,o;e=new t[4]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$b,then:create_then_block$b,catch:create_catch_block$b,value:30,blocks:[,,,]};return handle_promise(t[11](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$z(t){let e,n;return e=new t[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[create_default_slot$h]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};3&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$z(t,e,n){const r=createEventDispatcher(),{Dialog:o,Divider:i,Loading:a,TextField:s,Button:c}=getAttractions;let{item:l}=e,{classId:d}=e,{className:u}=e,{rowId:h}=e,{viewName:m}=e,{viewValue:f}=e,{recordId:p}=e,{filter:_}=e,{multiValues:g}=e,w="",$=d+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(t,e)=>{if(!e)return;const n=t[e.name];return"boolean"==typeof n?checkBoolean(n):checkDate(t[`_${e.name}`]||t[e.name]||"")},b=Request.getSchemaByClass(u);onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById($)?.focus()},200)}),task_notification.subscribe(async t=>{if(!t)return;const e=await b;t.eventId===e.id&&refreshList(e.class,t.eventId)});return t.$$set=t=>{"item"in t&&n(16,l=t.item),"classId"in t&&n(17,d=t.classId),"className"in t&&n(18,u=t.className),"rowId"in t&&n(0,h=t.rowId),"viewName"in t&&n(19,m=t.viewName),"viewValue"in t&&n(20,f=t.viewValue),"recordId"in t&&n(21,p=t.recordId),"filter"in t&&n(22,_=t.filter),"multiValues"in t&&n(23,g=t.multiValues)},[h,w,r,o,i,a,s,c,$,y,t=>()=>r("choose",{row:t}),async()=>{const t=await b;let e=[];if(l.lookup){const n="."+d+"#"+l.lookup,r=document.querySelector(n);let o=r?.value||p;if(g.has(l.lookup)){const n=g.get(l.lookup)[0];e=n?await Request.getSectionView(l.name,{[l.lookup]:n},!0):await getList(l.name,t.id)}else if(o&&24===o.toString().length){const t=await getTaskFull(l.lookup,o);if(t){const n=t[l.name]?.map(t=>t[l.name]);n&&(e=await Request.getSectionView(l.name,{_id:{$in:n}},!0))}}}else{const n="."+d+"#"+m.split(":")[0],r=document.querySelector(n);let o={[m]:r?.value||p};if(l.refItem){const t="."+d+"#"+l.refItem;try{const e=document.querySelector(t);if(e){const t={$or:[{[l.refItem]:e.value},{[l.refItem]:{$exists:!0,$eq:""}}]};o={...o,...t}}}catch{}}o[m]&&(e=await Request.getSectionView(t.class,o,!0)),_&&(e=e.filter(t=>t._id!=_))}const n=t.display;return{list:e,items:await getDisplayItems(n,t,e)}},({detail:{value:t}})=>{n(1,w=t)},(t,e,n)=>{if(!n)return!0;for(const r of e)if(y(t,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{n(1,w="")},t=>async()=>{const e=await Request.getTaskByDocId(t._id,!0),n=`/task/${e.event}/${e._id}/task?view=standalone`;window.open(n)},l,d,u,m,f,p,_,g,()=>r("back"),function(t){w=t,n(1,w)}]}class ViewList extends SvelteComponent{constructor(t){super(),document_1$f.getElementById("svelte-14hcfjl-style")||add_css$v(),init(this,t,instance$z,create_fragment$z,safe_not_equal,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23},[-1,-1])}}const{document:document_1$e}=globals;function add_css$u(){var t=element("style");t.id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",append(document_1$e.head,t)}function create_catch_block$a(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$a(t){let e,n,r=t[72]&&create_if_block$u(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,e){t[72]&&r.p(t,e)},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block$u(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$;function y(e){t[55](e)}function b(e){t[56](e)}let v={class:"full-width",id:t[32],rows:"1",required:t[2],disabled:t[3],placeholder:t[34],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==t[1]&&(v.value=t[1]),void 0!==t[25]&&(v.overwrite=t[25]),n=new TextArea({props:v}),binding_callbacks.push(()=>bind(n,"value",y)),binding_callbacks.push(()=>bind(n,"overwrite",b)),n.$on("click",t[37]()),n.$on("blur",t[44]);const I=[create_if_block_5$6,create_if_block_6$4],C=[];function E(t,e){return!t[3]||t[16]?0:t[22]&&t[0]?1:-1}~(a=E(t))&&(s=C[a]=I[a](t));let A=(!t[3]||t[16]||t[17])&&create_if_block_4$6(t);function S(e){t[57](e)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot_2$7]},$$scope:{ctx:t}};void 0!==t[19]&&(k.open=t[19]),m=new t[28]({props:k}),binding_callbacks.push(()=>bind(m,"open",S));let T=t[20]&&create_if_block_1$i(t);return{c(){e=element("div"),create_component(n.$$.fragment),i=space(),s&&s.c(),c=space(),l=element("input"),u=space(),A&&A.c(),h=space(),create_component(m.$$.fragment),p=space(),T&&T.c(),_=empty(),attr(l,"class",d=null_to_empty(t[9]||t[10])+" svelte-jox15l"),attr(l,"id",t[5]),attr(l,"name",t[5]),l.value=t[0],l.hidden=!0,set_style(e,"position","relative")},m(r,o){insert(r,e,o),mount_component(n,e,null),append(e,i),~a&&C[a].m(e,null),append(e,c),append(e,l),append(e,u),A&&A.m(e,null),insert(r,h,o),mount_component(m,r,o),insert(r,p,o),T&&T.m(r,o),insert(r,_,o),g=!0,w||($=listen(e,"keydown",t[38]),w=!0)},p(t,i){const u={};4&i[0]&&(u.required=t[2]),8&i[0]&&(u.disabled=t[3]),!r&&2&i[0]&&(r=!0,u.value=t[1],add_flush_callback(()=>r=!1)),!o&&33554432&i[0]&&(o=!0,u.overwrite=t[25],add_flush_callback(()=>o=!1)),n.$set(u);let h=a;a=E(t),a===h?~a&&C[a].p(t,i):(s&&(group_outros(),transition_out(C[h],1,1,()=>{C[h]=null}),check_outros()),~a?(s=C[a],s?s.p(t,i):(s=C[a]=I[a](t),s.c()),transition_in(s,1),s.m(e,c)):s=null),(!g||1536&i[0]&&d!==(d=null_to_empty(t[9]||t[10])+" svelte-jox15l"))&&attr(l,"class",d),(!g||32&i[0])&&attr(l,"id",t[5]),(!g||32&i[0])&&attr(l,"name",t[5]),(!g||1&i[0]&&l.value!==t[0])&&(l.value=t[0]),!t[3]||t[16]||t[17]?A?(A.p(t,i),196616&i[0]&&transition_in(A,1)):(A=create_if_block_4$6(t),A.c(),transition_in(A,1),A.m(e,null)):A&&(group_outros(),transition_out(A,1,1,()=>{A=null}),check_outros());const p={};93126097&i[0]|2048&i[2]&&(p.$$scope={dirty:i,ctx:t}),!f&&524288&i[0]&&(f=!0,p.open=t[19],add_flush_callback(()=>f=!1)),m.$set(p),t[20]?T?(T.p(t,i),1048576&i[0]&&transition_in(T,1)):(T=create_if_block_1$i(t),T.c(),transition_in(T,1),T.m(_.parentNode,_)):T&&(group_outros(),transition_out(T,1,1,()=>{T=null}),check_outros())},i(t){g||(transition_in(n.$$.fragment,t),transition_in(s),transition_in(A),transition_in(m.$$.fragment,t),transition_in(T),g=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(s),transition_out(A),transition_out(m.$$.fragment,t),transition_out(T),g=!1},d(t){t&&detach(e),destroy_component(n),~a&&C[a].d(),A&&A.d(),t&&detach(h),destroy_component(m,t),t&&detach(p),T&&T.d(t),t&&detach(_),w=!1,$()}}}function create_if_block_6$4(t){let e,n,r,o,i;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-jox15l")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[43]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_5$6(t){let e,n,r,o,i;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-jox15l")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=[listen(e,"click",t[37](!0)),listen(e,"choose",t[40])],o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,run_all(i)}}}function create_if_block_4$6(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 pointer svelte-jox15l")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[42]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_2$a(t){let e,n,r,o;const i=[create_if_block_3$6,create_else_block$f],a=[];function s(t,e){return t[6].lookup||t[4]&&!t[6].constraint?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_else_block$f(t){let e,n;return e=new FormList({props:{title:t[6].designation,newAllowed:t[23],prevEventId:t[11],schema:t[18],filter:t[33],query:t[35](),record:t[7],recID:t[0],isOpening:t[19],filterForReady:t[24],refStatus:t[6].refStatus,selectionFields:t[14],deList:t[15],praefix:t[13],shouldBlock:t[26],inputSearch:t[39]()}}),e.$on("choose",t[40]),e.$on("back",t[41]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.title=t[6].designation),8388608&n[0]&&(r.newAllowed=t[23]),2048&n[0]&&(r.prevEventId=t[11]),262144&n[0]&&(r.schema=t[18]),128&n[0]&&(r.record=t[7]),1&n[0]&&(r.recID=t[0]),524288&n[0]&&(r.isOpening=t[19]),16777216&n[0]&&(r.filterForReady=t[24]),64&n[0]&&(r.refStatus=t[6].refStatus),16384&n[0]&&(r.selectionFields=t[14]),32768&n[0]&&(r.deList=t[15]),8192&n[0]&&(r.praefix=t[13]),67108864&n[0]&&(r.shouldBlock=t[26]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_3$6(t){let e,n;return e=new ViewList({props:{item:t[6],className:t[18].class,classId:t[10],rowId:t[0],recordId:t[12],viewName:t[4],viewValue:"",multiValues:t[8]}}),e.$on("choose",t[40]),e.$on("back",t[41]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.item=t[6]),262144&n[0]&&(r.className=t[18].class),1024&n[0]&&(r.classId=t[10]),1&n[0]&&(r.rowId=t[0]),4096&n[0]&&(r.recordId=t[12]),16&n[0]&&(r.viewName=t[4]),256&n[0]&&(r.multiValues=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$7(t){let e,n,r=t[19]&&create_if_block_2$a(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[19]?r?(r.p(t,n),524288&n[0]&&transition_in(r,1)):(r=create_if_block_2$a(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_1$i(t){let e,n,r;function o(e){t[58](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$g]},$$scope:{ctx:t}};return void 0!==t[20]&&(i.open=t[20]),e=new t[28]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};2359297&r[0]|2048&r[2]&&(o.$$scope={dirty:r,ctx:t}),!n&&1048576&r[0]&&(n=!0,o.open=t[20],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$b(t){let e,n;return e=new Index({props:{schema:t[18],recID:t[0],readonly:!0}}),e.$on("back",t[41]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};262144&n[0]&&(r.schema=t[18]),1&n[0]&&(r.recID=t[0]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$g(t){let e,n;return e=new t[27]({props:{title:t[21],$$slots:{default:[create_default_slot_1$b]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2097152&n[0]&&(r.title=t[21]),262145&n[0]|2048&n[2]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_pending_block$a(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$y(t){let e,n,r={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$a,then:create_then_block$a,catch:create_catch_block$a,value:72,blocks:[,,,]};return handle_promise(t[36](),r),{c(){e=empty(),r.block.c()},m(t,o){insert(t,e,o),r.block.m(t,r.anchor=o),r.mount=()=>e.parentNode,r.anchor=e,n=!0},p(e,n){update_await_block_branch(r,t=e,n)},i(t){n||(transition_in(r.block),n=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(r.blocks[t])}n=!1},d(t){t&&detach(e),r.block.d(t),r.token=null,r=null}}}function instance$y(t,e,n){let r,o,i,a;component_subscribe(t,currentRoles,t=>n(54,r=t));const s=createEventDispatcher(),{Dialog:c,Modal:l}=getAttractions,{currentTasks:d,environment:u,loggedIn:h}=user;component_subscribe(t,d,t=>n(60,o=t)),component_subscribe(t,u,t=>n(62,a=t)),component_subscribe(t,h,t=>n(61,i=t));let{id:m}=e,{item:f}=e,{fullRecord:p}=e,{value:_=""}=e,{multiValues:g}=e,{desc:w=""}=e,{noForm:$=!1}=e,{classId:y}=e,{eventId:b}=e,{recordId:v}=e,{withRefValue:I=!1}=e,{refValue:C=""}=e,{shortEdit:E}=e,{required:A}=e,{disabled:S}=e,{readonly:k}=e,{praefix:T}=e,{selectionFields:R}=e,{formnovalidate:N}=e,{selection:D}=e,{deList:x}=e,{isTemplate:O}=e,{noList:M=!1}=e,{multi:P=!1}=e,{initFinished:B}=e;const F="comment_"+m,L=f.filter;let q,V,H,U,z,W,j=!1,G=!0,X=!0,Q=!0,Y=!1,Z="";k||=v&&f.asInput,S||=k,!D&&f.selection&&1===f.selection.split(":").length&&(D=f.selection);const K=k||S||f.lookup||D&&!f.constraint?"":"Suchbegriff ⏎",J=()=>{f.refItem&&f.refItem.startsWith("owner")&&(n(46,C=a.owner[f.refClass]),C||n(46,C=((t,e)=>{try{return t.split(".").reduce((t,e)=>t[e],e)}catch(t){return""}})(f.refItem,a)),C&&(n(45,I=!0),s("change",{value:C})))},tt=async t=>{t.items.filter(t=>t.properties?.default).forEach(e=>{s("defPrep",{className:t.class,itemName:e.name,value:e.properties.default})})},et=async t=>{const e=()=>{n(19,j=!0)};if(9==t.which)return;if(_)return t.preventDefault();if(13!=t.which)return;t.preventDefault();const r=H.items.find(t=>t.properties?.search);if(!r)return e();const o=t.srcElement.value,{name:i,checkOn:a,refClass:s,properties:c}=r;let{search:l}=c;!0===l&&(l={}),"number"==typeof l&&(l={min:l});const{min:d=3,start:u=!1,end:h=!1}=l;if(o.length<d)return e();const m=(u?"^":"")+o+(h?"$":"");let f={[i]:{$regex:m,$options:"i"}};a&&(f=[{$lookup:{from:s,localField:i,foreignField:"_id",as:s}},{$match:{[s+"."+a]:{$regex:m,$options:"i"}}}]);const p=await Request.getSectionView(H.class,f);1!==p?.length?e():n(0,_=p[0]._id)},nt=t=>{t&&(n(53,Z=n(1,w=getRecordDescription(H,t))),s("setRefDesc",w.split(" •")[0]),s("change",{value:_,description:w}),s("task",{row:t,eventId:H.id}))},rt=()=>{n(19,j=!1),n(20,q=!1)};return t.$$set=t=>{"id"in t&&n(5,m=t.id),"item"in t&&n(6,f=t.item),"fullRecord"in t&&n(7,p=t.fullRecord),"value"in t&&n(0,_=t.value),"multiValues"in t&&n(8,g=t.multiValues),"desc"in t&&n(1,w=t.desc),"noForm"in t&&n(9,$=t.noForm),"classId"in t&&n(10,y=t.classId),"eventId"in t&&n(11,b=t.eventId),"recordId"in t&&n(12,v=t.recordId),"withRefValue"in t&&n(45,I=t.withRefValue),"refValue"in t&&n(46,C=t.refValue),"shortEdit"in t&&n(49,E=t.shortEdit),"required"in t&&n(2,A=t.required),"disabled"in t&&n(3,S=t.disabled),"readonly"in t&&n(48,k=t.readonly),"praefix"in t&&n(13,T=t.praefix),"selectionFields"in t&&n(14,R=t.selectionFields),"formnovalidate"in t&&n(50,N=t.formnovalidate),"selection"in t&&n(4,D=t.selection),"deList"in t&&n(15,x=t.deList),"isTemplate"in t&&n(16,O=t.isTemplate),"noList"in t&&n(51,M=t.noList),"multi"in t&&n(17,P=t.multi),"initFinished"in t&&n(47,B=t.initFinished)},t.$$.update=()=>{if(4&t.$$.dirty[0]|524288&t.$$.dirty[1]&&n(2,A=A&&!N),49152&t.$$.dirty[1]&&I&&n(0,_=C),3&t.$$.dirty[0]|4194304&t.$$.dirty[1]&&!w&&_&&Z&&n(1,w=Z),399425&t.$$.dirty[0]|1114112&t.$$.dirty[1]&&_&&H){let t=!1;if(!Array.isArray(_)){const e=f.properties?.prefetch?500:0;if(v||f.asInput||f.upate||!1!==f.refItem||!0===P||!1===f.refItem&&B)if(e){const e="p$"+f.refClass+"$"+b,n=getList2(e);n?n.then(t=>{const e=t.find(({_id:t})=>t===_);e?nt(e):getTask(f.refClass,H.id,_,!!f.lookup||M).then(nt)}):t=!0}else t=!0;t&&getTask(f.refClass,H.id,_,!!f.lookup||M).then(nt),n(47,B=!0)}}if(65&t.$$.dirty[0]|10485760&t.$$.dirty[1]&&_&&U&&f.name===U.input?.at(0)&&U.inputLookup?.length){const{domain:t}=U.inputLookup[0]||{};"user"===t&&(r.some(t=>U.authorization?.find(e=>e.role===t&&!e.constraint))||n(3,S=!0))}262145&t.$$.dirty[0]&&!_&&H&&nt({})},[_,w,A,S,D,m,f,p,g,$,y,b,v,T,R,x,O,P,H,j,q,V,z,G,X,Q,Y,c,l,d,u,h,F,L,K,()=>{if(!f.query)return;const[t,e]=f.query.split(".");if(!p[e])return;let n=[{$lookup:{from:t,localField:t,foreignField:"_id",as:"__"+t}},{$unwind:{path:"$__"+t,preserveNullAndEmptyArrays:!0}},{$match:{["__"+t+"."+e]:p[e]}}];return f.refStatus&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":f.refStatus}}])),n},async()=>{try{const t=await Request.getEvent(b);if(W="report"===t.output.type,n(24,X=!f.asInput),n(23,G=t.output?.class[0].name!==f.refClass),n(18,H=await Request.getSchemaByClass(f.refClass)),H?.blocked)return s("initFail",!0),!1;if(W||n(26,Y=((t,e)=>{let n=e.items.find(t=>!!t.properties?.blocking);if(!n)return!1;if(t.input?.class?.find(t=>t.name===e.class))return n.name;const r=t.output?.class.at(0)?.list||[];for(const t of r){const e=t.item.find(t=>t.name===f.name);if(e?.properties?.blocking)return n.name}return!1})(t,H)),tt(H),n(22,z=(t=>!o?.length||!!o.find(e=>e===t))(H.id)),n(52,U=await Request.getSchema(b)),b&&v&&_&&!S&&U.input?.find(t=>t===f.refClass)&&n(3,S=!0),t.input?.class&&t.input.class[0]&&(t.input.class[0].name===f.refClass&&t.input.class[0].readonly&&n(3,S=!0),v&&t.input.class[0].name===f.refClass&&t.input.class[0].writeState)){(await Request.getTaskByDocId(v,!0)).status===t.input.class[0].writeState&&n(3,S=n(48,k=!1))}if(f.properties?.query?.lookup){const{domain:t,value:e}=f.properties.query.lookup;if("user"===t){const t=i.user,o={[e]:t},a=await Request.getSectionView(f.refClass,o);if(a?.length){const[{_id:t}]=a;t&&(n(46,C=t),n(45,I=!0),s("change",{value:C}))}r.some(t=>H.authorization?.find(e=>e.role===t&&!e.constraint))||n(3,S=!0)}}else J();if(!C&&f.filter&&(""===T||void 0===T)){const t=f.filter,e=!0;t.startsWith("!")&&(e=!1,t=t.slice(1));const r=await Request.getOneAndOnly(f.refClass,{[f.filter]:e});r&&(n(46,C=r._id),n(45,I=!0),s("change",{value:C}))}return n(21,V=H.identity.designation),!0}catch{return s("initFail",!0),!1}},t=>e=>{if(e.stopPropagation(),!0===t&&n(19,j=!0),t&&"BUTTON"===e.explicitOriginalTarget?.nodeName){const e=document.getElementById(t);return e?.blur()}(f.lookup||D&&!f.constraint||_)&&n(19,j=!0)},et,()=>{if(_)return"";const t=document.getElementById(F);return n(1,w=""),t?.value||""},({detail:t})=>{n(0,_=t.row._id),rt()},rt,()=>{(W||z)&&(P?s("change",{value:_,delete:!0}):(n(0,_=""),n(1,w=""),n(25,Q=!0),s("change",{value:_,description:w}),s("task",{row:{_task:{event:H.id,_id:!1}}})))},async()=>{if(!_)return;let t=await getTask(f.refClass,H.id,_);t._task||(t={_task:await Request.getTaskByDocId(_,!0)});const e=t._task.task_id||t._task._id,n=`/task/${t._task.event}/${e}/task?view=standalone`;window.open(n)},t=>{_||w&&et({which:13,preventDefault:()=>{},srcElement:{value:w}})},I,C,B,k,E,N,M,U,Z,r,function(t){w=t,n(1,w),n(0,_),n(53,Z),n(45,I),n(46,C)},function(t){Q=t,n(25,Q)},function(t){j=t,n(19,j)},function(t){q=t,n(20,q)}]}class InputReference extends SvelteComponent{constructor(t){super(),document_1$e.getElementById("svelte-jox15l-style")||add_css$u(),init(this,t,instance$y,create_fragment$y,safe_not_equal,{id:5,item:6,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:45,refValue:46,shortEdit:49,required:2,disabled:3,readonly:48,praefix:13,selectionFields:14,formnovalidate:50,selection:4,deList:15,isTemplate:16,noList:51,multi:17,initFinished:47},[-1,-1,-1])}}function add_css$t(){var t=element("style");t.id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",append(document.head,t)}function get_each_context$c(t,e,n){const r=t.slice();return r[40]=e[n],r[42]=n,r}function create_catch_block$9(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$9(t){let e,n;return e=new t[16]({props:{outline:!0,$$slots:{default:[create_default_slot_3$2]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8191&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_1$h(t){let e,n,r,o,i;return n=new ListIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",function(){is_function(t[22](t[0]))&&t[22](t[0]).apply(this,arguments)}),o=!0)},p(e,n){t=e},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block$c(t){let e,n;return e=new InputReference({props:{classId:t[6],eventId:t[7],required:t[9],disabled:t[1],formnovalidate:t[12],readonly:t[10],id:t[2]+"."+t[42],item:t[3],desc:t[4],value:t[40],noForm:t[5],praefix:t[11],recordId:t[8],multi:!0}}),e.$on("change",t[24]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.classId=t[6]),128&n[0]&&(r.eventId=t[7]),512&n[0]&&(r.required=t[9]),2&n[0]&&(r.disabled=t[1]),4096&n[0]&&(r.formnovalidate=t[12]),1024&n[0]&&(r.readonly=t[10]),4&n[0]&&(r.id=t[2]+"."+t[42]),8&n[0]&&(r.item=t[3]),16&n[0]&&(r.desc=t[4]),1&n[0]&&(r.value=t[40]),32&n[0]&&(r.noForm=t[5]),2048&n[0]&&(r.praefix=t[11]),256&n[0]&&(r.recordId=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_3$2(t){let e,n,r,o=!t[10]&&create_if_block_1$h(t),i=[].concat(t[0]),a=[];for(let e=0;e<i.length;e+=1)a[e]=create_each_block$c(get_each_context$c(t,i,e));const s=t=>transition_out(a[t],1,1,()=>{a[t]=null});return{c(){o&&o.c(),e=space();for(let t=0;t<a.length;t+=1)a[t].c();n=empty()},m(t,i){o&&o.m(t,i),insert(t,e,i);for(let e=0;e<a.length;e+=1)a[e].m(t,i);insert(t,n,i),r=!0},p(t,r){if(t[10]?o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros()):o?(o.p(t,r),1024&r[0]&&transition_in(o,1)):(o=create_if_block_1$h(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)),16785407&r[0]){let e;for(i=[].concat(t[0]),e=0;e<i.length;e+=1){const o=get_each_context$c(t,i,e);a[e]?(a[e].p(o,r),transition_in(a[e],1)):(a[e]=create_each_block$c(o),a[e].c(),transition_in(a[e],1),a[e].m(n.parentNode,n))}for(group_outros(),e=i.length;e<a.length;e+=1)s(e);check_outros()}},i(t){if(!r){transition_in(o);for(let t=0;t<i.length;t+=1)transition_in(a[t]);r=!0}},o(t){transition_out(o),a=a.filter(Boolean);for(let t=0;t<a.length;t+=1)transition_out(a[t]);r=!1},d(t){o&&o.d(t),t&&detach(e),destroy_each(a,t),t&&detach(n)}}}function create_pending_block$9(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_if_block$t(t){let e,n;return e=new t[18]({props:{title:t[14].designation,class:"eList",$$slots:{default:[create_default_slot_1$a]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16384&n[0]&&(r.title=t[14].designation),49480&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$6(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_1$a(t){let e,n,r,o,i;return n=new t[19]({props:{outline:!0,$$slots:{default:[create_default_slot_2$6]},$$scope:{ctx:t}}}),n.$on("click",t[25]),o=new List$1({props:{item:t[3],className:t[14].class,classId:t[6],rowId:t[15],recordId:t[8],inputList:t[21]()}}),o.$on("choose",t[23]),o.$on("back",t[25]),{c(){e=element("div"),create_component(n.$$.fragment),r=space(),create_component(o.$$.fragment),attr(e,"class","form--buttons")},m(t,a){insert(t,e,a),mount_component(n,e,null),insert(t,r,a),mount_component(o,t,a),i=!0},p(t,e){const r={};4096&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const i={};8&e[0]&&(i.item=t[3]),16384&e[0]&&(i.className=t[14].class),64&e[0]&&(i.classId=t[6]),32768&e[0]&&(i.rowId=t[15]),256&e[0]&&(i.recordId=t[8]),o.$set(i)},i(t){i||(transition_in(n.$$.fragment,t),transition_in(o.$$.fragment,t),i=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(o.$$.fragment,t),i=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),destroy_component(o,t)}}}function create_default_slot$f(t){let e,n,r=t[13]&&create_if_block$t(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[13]?r?(r.p(t,n),8192&n[0]&&transition_in(r,1)):(r=create_if_block$t(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_fragment$x(t){let e,n,r,o,i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$9,then:create_then_block$9,catch:create_catch_block$9,value:39,blocks:[,,,]};function a(e){t[34](e)}handle_promise(t[20](),i);let s={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$f]},$$scope:{ctx:t}};return void 0!==t[13]&&(s.open=t[13]),n=new t[17]({props:s}),binding_callbacks.push(()=>bind(n,"open",a)),{c(){i.block.c(),e=space(),create_component(n.$$.fragment)},m(t,r){i.block.m(t,i.anchor=r),i.mount=()=>e.parentNode,i.anchor=e,insert(t,e,r),mount_component(n,t,r),o=!0},p(e,o){update_await_block_branch(i,t=e,o);const a={};57672&o[0]|4096&o[1]&&(a.$$scope={dirty:o,ctx:t}),!r&&8192&o[0]&&(r=!0,a.open=t[13],add_flush_callback(()=>r=!1)),n.$set(a)},i(t){o||(transition_in(i.block),transition_in(n.$$.fragment,t),o=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}transition_out(n.$$.fragment,t),o=!1},d(t){i.block.d(t),i.token=null,i=null,t&&detach(e),destroy_component(n,t)}}}function instance$x(t,e,n){const r=createEventDispatcher(),{Card:o,Modal:i,Dialog:a,Button:s}=getAttractions;let c,l,{id:d}=e,{item:u}=e,{record:h}=e,{values:m=[]}=e,{desc:f=""}=e,{noForm:p=!1}=e,{classId:_}=e,{eventId:g}=e,{recordId:w}=e,{withRefValue:$=!1}=e,{refValue:y=""}=e,{required:b}=e,{disabled:v}=e,{readonly:I}=e,{praefix:C}=e,{selectionFields:E}=e,{formnovalidate:A}=e,{selection:S}=e,{deList:k}=e,{isTemplate:T}=e,{noList:R=!1}=e,N=!1;const{lookup:D,filter:x,constraint:O}=u.properties.multi;v=!0;const M=()=>{n(13,N=!1)};return t.$$set=t=>{"id"in t&&n(2,d=t.id),"item"in t&&n(3,u=t.item),"record"in t&&n(26,h=t.record),"values"in t&&n(0,m=t.values),"desc"in t&&n(4,f=t.desc),"noForm"in t&&n(5,p=t.noForm),"classId"in t&&n(6,_=t.classId),"eventId"in t&&n(7,g=t.eventId),"recordId"in t&&n(8,w=t.recordId),"withRefValue"in t&&n(27,$=t.withRefValue),"refValue"in t&&n(28,y=t.refValue),"required"in t&&n(9,b=t.required),"disabled"in t&&n(1,v=t.disabled),"readonly"in t&&n(10,I=t.readonly),"praefix"in t&&n(11,C=t.praefix),"selectionFields"in t&&n(29,E=t.selectionFields),"formnovalidate"in t&&n(12,A=t.formnovalidate),"selection"in t&&n(30,S=t.selection),"deList"in t&&n(31,k=t.deList),"isTemplate"in t&&n(32,T=t.isTemplate),"noList"in t&&n(33,R=t.noList)},[m,v,d,u,f,p,_,g,w,b,I,C,A,N,c,l,o,i,a,s,async()=>{n(0,m=[].concat(m)),n(14,c=await Request.getSchemaByClass(u.refClass))},async()=>{let t=await getList(c.class,c.id);if(!t?.length)return[];if(D&&(t=t.filter(t=>h[D]===t[D])),O&&t?.length){const{refClass:e,refStatus:n}=O,r=[{$match:{[c.class]:{$in:t.map(({_id:t})=>t)}}},{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":n}}],o=await Request.getSectionView(e,r);t=t.filter(t=>!!o.find(e=>e.project==t._id))}if(x)for(const e in x)t=t.filter(t=>{let[n,r]=e.split(".");if(r||(r=n,n=""),n){if(t[n][0]&&t[n][0][r].length)return!0}else if(t[r])return!0;return!1});return t},t=>()=>{I||(t=[].concat(t),n(13,N=!0),n(15,l=t))},({detail:t})=>{const e=t.row._id;n(0,m=[].concat(m)),Array.isArray(m)&&!m.find(t=>t===e)&&n(0,m=m.concat(t.row._id)),M()},({detail:t})=>{n(0,m=[].concat(m)),t.delete&&n(0,m=m.filter(e=>e!==t.value)),t.value=m,r("change",t),r("multi",{lookup:D,filter:x,name:u.name,value:m})},M,h,$,y,E,S,k,T,R,function(t){N=t,n(13,N)}]}class InputReferenceMulti extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-1m792ni-style")||add_css$t(),init(this,t,instance$x,create_fragment$x,safe_not_equal,{id:2,item:3,record:26,values:0,desc:4,noForm:5,classId:6,eventId:7,recordId:8,withRefValue:27,refValue:28,required:9,disabled:1,readonly:10,praefix:11,selectionFields:29,formnovalidate:12,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const numberRegex=/\d+/g,formatSpecifierRegex=/%[HMSpPdmyY%]/g;function parseDateTime(t,e,n){const r=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===t)return null;const i=e.split(formatSpecifierRegex);let a=0,s=0;const c=new Date(0);for(const l of i){if(!t.startsWith(l,a))return n;if(a+=l.length,a===t.length){if(s!==e.length)return n;break}if("%"!==e[s+l.length])break;if(s+=l.length+1,"%"===e[s]){if("%"!==t[a])return n;a++}else if("p"===e[s].toLowerCase()){const e=t.substr(a,2).toUpperCase();if("AM"===e)o=!1,c.getHours()>=12&&c.setHours(c.getHours()-12);else{if("PM"!==e)return n;o=!0,c.getHours()<12&&c.setHours(c.getHours()+12)}}else{numberRegex.lastIndex=a;const i=numberRegex.exec(t);if(null==i)return n;switch(e[s]){case"H":c.setHours(parseInt(i[0])+12*o);break;case"M":c.setMinutes(i[0]);break;case"S":c.setSeconds(i[0]);break;case"d":c.setDate(i[0]);break;case"m":c.setMonth(i[0]-1);break;case"y":c.setFullYear(100*r+parseInt(i[0]));break;case"Y":c.setFullYear(i[0])}a+=i[0].length}s++}return isNaN(c.valueOf())?n:c}function formatDateTime(t,e){if(null==t)return null;let n=t.getHours();return/%p/i.test(e)&&(n%=12,0===n&&(n=12)),e.replace("%Y",t.getFullYear()).replace("%y",(t.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(t.getMonth()+1).toString().padStart(2,"0")).replace("%d",t.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",t.getMinutes().toString().padStart(2,"0")).replace("%S",t.getSeconds().toString().padStart(2,"0")).replace("%p",t.getHours()<12?"am":"pm").replace("%P",t.getHours()<12?"AM":"PM").replace("%%","%")}function applyDate(t,e){return null==t||null==e?t:(e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e)}function applyTime(t,e){return null==t||null==e?t:(e.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),e)}const{document:document_1$d}=globals;function add_css$s(){var t=element("style");t.id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",append(document_1$d.head,t)}function get_each_context$b(t,e,n){const r=t.slice();return r[17]=e[n],r}function get_each_context_1$7(t,e,n){const r=t.slice();return r[20]=e[n],r}function create_catch_block$8(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$8(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f=t[0].items,p=[];for(let e=0;e<f.length;e+=1)p[e]=create_each_block_1$7(get_each_context_1$7(t,f,e));const _=t=>transition_out(p[t],1,1,()=>{p[t]=null});let g=t[0].list&&create_if_block$s(t);return c=new t[5]({props:{outline:!0,$$slots:{default:[create_default_slot_1$9]},$$scope:{ctx:t}}}),c.$on("click",t[9]),d=new t[5]({props:{disabled:t[2],class:"close",form:t[6],filled:!0,type:"submit",$$slots:{default:[create_default_slot$e]},$$scope:{ctx:t}}}),{c(){e=element("form"),n=element("input"),o=space();for(let t=0;t<p.length;t+=1)p[t].c();i=space(),g&&g.c(),a=space(),s=element("div"),create_component(c.$$.fragment),l=space(),create_component(d.$$.fragment),attr(n,"class",null_to_empty(t[6])+" svelte-1phofh5"),attr(n,"name","_id"),attr(n,"type","hidden"),n.value=r=t[1]._id||"",attr(e,"class","fTask svelte-1phofh5"),attr(e,"id",t[6]),attr(s,"class","form--buttons svelte-1phofh5")},m(r,f){insert(r,e,f),append(e,n),append(e,o);for(let t=0;t<p.length;t+=1)p[t].m(e,null);append(e,i),g&&g.m(e,null),insert(r,a,f),insert(r,s,f),mount_component(c,s,null),append(s,l),mount_component(d,s,null),u=!0,h||(m=[listen(e,"keydown",t[8]),listen(e,"submit",prevent_default(t[10]))],h=!0)},p(t,o){if((!u||2&o&&r!==(r=t[1]._id||""))&&(n.value=r),75&o){let n;for(f=t[0].items,n=0;n<f.length;n+=1){const r=get_each_context_1$7(t,f,n);p[n]?(p[n].p(r,o),transition_in(p[n],1)):(p[n]=create_each_block_1$7(r),p[n].c(),transition_in(p[n],1),p[n].m(e,i))}for(group_outros(),n=f.length;n<p.length;n+=1)_(n);check_outros()}t[0].list?g?(g.p(t,o),1&o&&transition_in(g,1)):(g=create_if_block$s(t),g.c(),transition_in(g,1),g.m(e,null)):g&&(group_outros(),transition_out(g,1,1,()=>{g=null}),check_outros());const a={};8388608&o&&(a.$$scope={dirty:o,ctx:t}),c.$set(a);const s={};4&o&&(s.disabled=t[2]),8388608&o&&(s.$$scope={dirty:o,ctx:t}),d.$set(s)},i(t){if(!u){for(let t=0;t<f.length;t+=1)transition_in(p[t]);transition_in(g),transition_in(c.$$.fragment,t),transition_in(d.$$.fragment,t),u=!0}},o(t){p=p.filter(Boolean);for(let t=0;t<p.length;t+=1)transition_out(p[t]);transition_out(g),transition_out(c.$$.fragment,t),transition_out(d.$$.fragment,t),u=!1},d(t){t&&detach(e),destroy_each(p,t),g&&g.d(),t&&detach(a),t&&detach(s),destroy_component(c),destroy_component(d),h=!1,run_all(m)}}}function create_if_block_1$g(t){let e,n;return e=new InputFormField({props:{classId:t[6],item:t[20],selection:t[20].selection,record:t[1],disabled:t[3],eventId:t[0].id,required:!1,isTemplate:!0}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.item=t[20]),1&n&&(r.selection=t[20].selection),2&n&&(r.record=t[1]),8&n&&(r.disabled=t[3]),1&n&&(r.eventId=t[0].id),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_1$7(t){let e,n,r=checkType(!0,t[20]),o=r&&create_if_block_1$g(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){1&n&&(r=checkType(!0,t[20])),r?o?(o.p(t,n),1&n&&transition_in(o,1)):(o=create_if_block_1$g(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_if_block$s(t){let e,n,r=t[0].list,o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$b(get_each_context$b(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(75&n){let a;for(r=t[0].list,a=0;a<r.length;a+=1){const i=get_each_context$b(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$b(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_each_block$b(t){let e,n,r,o;return e=new t[4]({props:{text:t[17].designation}}),r=new InputObject({props:{classId:t[6],list:t[17],eventId:t[0].id,schema:t[17].item,record:t[1],disabled:t[3],required:!1,open:!0,isTemplate:!0}}),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};1&n&&(o.text=t[17].designation),e.$set(o);const i={};1&n&&(i.list=t[17]),1&n&&(i.eventId=t[0].id),1&n&&(i.schema=t[17].item),2&n&&(i.record=t[1]),8&n&&(i.disabled=t[3]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_default_slot_1$9(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot$e(t){let e;return{c(){e=text("Speichern")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_pending_block$8(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$w(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$8,then:create_then_block$8,catch:create_catch_block$8,value:16,blocks:[,,,]};return handle_promise(t[7](),o),{c(){e=space(),n=element("section"),o.block.c(),document_1$d.title="Vorgaben",attr(n,"class","sTask svelte-1phofh5")},m(t,i){insert(t,e,i),insert(t,n,i),o.block.m(n,o.anchor=null),o.mount=()=>n,o.anchor=null,r=!0},p(e,[n]){update_await_block_branch(o,t=e,n)},i(t){r||(transition_in(o.block),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}r=!1},d(t){t&&detach(e),t&&detach(n),o.block.d(),o.token=null,o=null}}}const checkType=(t,{type:e="",properties:n={}})=>!t||"list"!==e&&("time"===n.format&&(e="time"),!["date","datetime","time"].includes(e)&&(!n.readonly&&!n.hidden));function instance$w(t,e,n){let r,o,i;component_subscribe(t,settings,t=>n(11,o=t)),component_subscribe(t,currentRoles,t=>n(12,i=t));const{Divider:a,Button:s,FormField:c}=getAttractions,l=JSON.parse(Storage.getItem("Locale"));let{schema:d}=e,{record:u}=e,h="template-"+d.class+Math.floor(9e3*Math.random()+1e3).toString(),m=!1;const f=()=>window.history.back(),p=(t,e,n=!1)=>{const r=e.id,o=t.find(t=>t.name===r);let i=e.value;if(!n&&o&&o.properties?.multi&&(i=u[r]),i&&o&&o.type.startsWith("date"))try{return parseDateTime(i,"%d.%m.%Y").toISOString()}catch{return new Date(i).toISOString()}if(o&&"boolean"===o.type&&(i=!!e.checked),o&&"number"===o.type){const t=Number("1.1").toLocaleString(l.id).substring(1,2);try{i=Number(i.replace(t,".")).toString()}catch{}}return i};return t.$$set=t=>{"schema"in t&&n(0,d=t.schema),"record"in t&&n(1,u=t.record)},t.$$.update=()=>{4&t.$$.dirty&&n(3,r=m)},[d,u,m,r,a,s,h,async()=>{const t=await Request.getEvent(d.id);if(t.trigger?.startOn&&!t.trigger?.startOn?.some(t=>"Manual"===t.type)&&n(2,m=!0),o.role?.length&&d.authorization?.length){const t=d.authorization.some(t=>i?.find(e=>e===t.role&&"edit"===t.activity));n(2,m||=!t)}},t=>{"button"!==t.srcElement?.type&&"textarea"!==t.srcElement?.type&&13==t.which&&t.preventDefault()},f,async t=>{const e={};Array.from(document.querySelectorAll("form#"+h+" ."+h)).map(t=>{const n=t.id||t.name;if(n)if(n.includes(".")){const[r,o]=n.split("."),i=d.list.find(t=>t.name===r);e[n]=p(i.item,t)}else e[n]=p(d.items,t)}),await Request.saveTemplate(d.class,e),toasts.success("Die Vorgaben wurden gespeichert.",2e3),f()}]}class Template$1 extends SvelteComponent{constructor(t){super(),document_1$d.getElementById("svelte-1phofh5-style")||add_css$s(),init(this,t,instance$w,create_fragment$w,safe_not_equal,{schema:0,record:1})}}const{document:document_1$c}=globals;function add_css$r(){var t=element("style");t.id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",append(document_1$c.head,t)}function get_each_context$a(t,e,n){const r=t.slice();return r[28]=e[n],r}function create_if_block$r(t){let e,n;return e=new InputFormField({props:{classId:t[2],item:t[28],listName:t[1].name,eventId:t[3],record:t[0],disabled:t[4],required:t[5],currency:t[8]}}),e.$on("notify",t[14]),e.$on("defPrep",t[16]),e.$on("task",t[21]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4&n[0]&&(r.classId=t[2]),2&n[0]&&(r.item=t[28]),2&n[0]&&(r.listName=t[1].name),8&n[0]&&(r.eventId=t[3]),1&n[0]&&(r.record=t[0]),16&n[0]&&(r.disabled=t[4]),32&n[0]&&(r.required=t[5]),256&n[0]&&(r.currency=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block$a(t){let e,n,r=checkType(t[7],t[28]),o=r&&create_if_block$r(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){130&n[0]&&(r=checkType(t[7],t[28])),r?o?(o.p(t,n),130&n[0]&&transition_in(o,1)):(o=create_if_block$r(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_default_slot_2$5(t){let e,n,r,o=t[1].item,i=[];for(let e=0;e<o.length;e+=1)i[e]=create_each_block$a(get_each_context$a(t,o,e));const a=t=>transition_out(i[t],1,1,()=>{i[t]=null});return{c(){e=element("div");for(let t=0;t<i.length;t+=1)i[t].c();attr(e,"id",n=`accordion-content-${t[2]}-${t[1].name}`)},m(t,n){insert(t,e,n);for(let t=0;t<i.length;t+=1)i[t].m(e,null);r=!0},p(t,s){if(82367&s[0]){let n;for(o=t[1].item,n=0;n<o.length;n+=1){const r=get_each_context$a(t,o,n);i[n]?(i[n].p(r,s),transition_in(i[n],1)):(i[n]=create_each_block$a(r),i[n].c(),transition_in(i[n],1),i[n].m(e,null))}for(group_outros(),n=o.length;n<i.length;n+=1)a(n);check_outros()}(!r||6&s[0]&&n!==(n=`accordion-content-${t[2]}-${t[1].name}`))&&attr(e,"id",n)},i(t){if(!r){for(let t=0;t<o.length;t+=1)transition_in(i[t]);r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)transition_out(i[t]);r=!1},d(t){t&&detach(e),destroy_each(i,t)}}}function create_default_slot_1$8(t){let e,n,r=t[13](t[9])+"";return{c(){e=element("span"),n=text(r)},m(t,r){insert(t,e,r),append(e,n)},p(t,e){512&e[0]&&r!==(r=t[13](t[9])+"")&&set_data(n,r)},d(t){t&&detach(e)}}}function create_handle_slot$1(t){let e,n,r;return n=new t[10]({props:{$$slots:{default:[create_default_slot_1$8]},$$scope:{ctx:t}}}),n.$on("click",function(){is_function(t[15](t[27]))&&t[15](t[27]).apply(this,arguments)}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"class","accordion svelte-148ktt9"),attr(e,"slot","handle")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(e,r){t=e;const o={};512&r[0]|1&r[1]&&(o.$$scope={dirty:r,ctx:t}),n.$set(o)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot$d(t){let e,n;return e=new t[12]({props:{open:t[6],$$slots:{handle:[create_handle_slot$1,({toggle:t})=>({27:t}),({toggle:t})=>[t?134217728:0]],default:[create_default_slot_2$5,({toggle:t})=>({27:t}),({toggle:t})=>[t?134217728:0]]},$$scope:{ctx:t}}}),e.$on("panel-open",t[17]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.open=t[6]),134218687&n[0]|1&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$v(t){let e,n,r;return n=new t[11]({props:{$$slots:{default:[create_default_slot$d]},$$scope:{ctx:t}}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"class","formList")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(t,e){const r={};1023&e[0]|1&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function instance$v(t,e,n){const{Button:r,Accordion:o,AccordionSection:i}=getAttractions;let{list:a}=e,{schema:s}=e,{record:c}=e,{classId:l}=e,{eventId:d}=e,{disabled:u}=e,{required:h}=e,{open:m=!1}=e,{template:f={}}=e,{isTemplate:p=!1}=e,{currency:_}=e,{update:g=!1}=e,w=new Map;const $={};let y=c[a.name]||{};c[a.name]=y;const b=t=>$[t]?.split(" • ").filter(t=>!!t).slice(0,2).join(" · "),v=t=>{if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n}px`)};return t.$$set=t=>{"list"in t&&n(1,a=t.list),"schema"in t&&n(18,s=t.schema),"record"in t&&n(0,c=t.record),"classId"in t&&n(2,l=t.classId),"eventId"in t&&n(3,d=t.eventId),"disabled"in t&&n(4,u=t.disabled),"required"in t&&n(5,h=t.required),"open"in t&&n(6,m=t.open),"template"in t&&n(19,f=t.template),"isTemplate"in t&&n(7,p=t.isTemplate),"currency"in t&&n(8,_=t.currency),"update"in t&&n(20,g=t.update)},t.$$.update=()=>{1048579&t.$$.dirty[0]&&g&&c&&n(9,y=c[a.name]||{})},[c,a,l,d,u,h,m,p,_,y,r,o,i,t=>s.filter(e=>void 0!==t[e.name]&&"textarea"!==e.properties?.format&&"html"!==e.properties?.format).map(e=>"object"===e.type?b(e.name):"boolean"===e.type?checkBoolean(t[e.name]):"date"===e.type?checkDate(t[e.name]):"datetime"===e.type?checkDateTime(t[e.name]):t[e.name]).filter(t=>!!t).join(" • ")||"+",({detail:t})=>{const[e,r]=t.itemName.split(".");if(!r)return;t.desc&&($[r]=t.desc);const o=c[e];n(0,c[e]={...o,[r]:t.value},c),n(9,y=c[e])},t=>e=>{(()=>{const t=f[a.name]||{};for(const e in t)f[a.name][e]&&!c[a.name][e]&&n(0,c[a.name][e]=f[a.name][e],c)})(),t(e);const r=`#accordion-content-${l}-${a.name} > div.form-field:last-child`,o=document.querySelector(r);tick().then(()=>{const t=`#accordion-content-${l}-${a.name} textarea`;Array.from(document.querySelectorAll(t)).forEach(v)}).then(()=>o.scrollIntoView({behavior:"smooth",block:"end"}))},async({detail:{className:t,itemName:e,value:n}})=>{if(w.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===className+"."+a.name)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&w.set(t,o[0])},()=>{setTimeout(()=>{Array.from(w).forEach(([t,e])=>{c[a.name][t]||n(0,c[a.name][t]=e._id,c)})},500)},s,f,g,function(e){bubble(t,e)}]}class InputObject extends SvelteComponent{constructor(t){super(),document_1$c.getElementById("svelte-148ktt9-style")||add_css$r(),init(this,t,instance$v,create_fragment$v,safe_not_equal,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:document_1$b}=globals;function add_css$q(){var t=element("style");t.id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",append(document_1$b.head,t)}function get_then_context$2(t){t[0]=t[23].list,t[22]=t[23].items}function get_each_context$9(t,e,n){const r=t.slice();return r[24]=e[n],r}function get_each_context_1$6(t,e,n){const r=t.slice();return r[27]=e[n],r}function get_each_context_2$4(t,e,n){const r=t.slice();return r[27]=e[n],r}function create_catch_block$7(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$7(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w;function $(e){t[19](e)}get_then_context$2(t),n=new t[7]({props:{outline:!0,$$slots:{default:[create_default_slot_1$7]},$$scope:{ctx:t}}}),n.$on("click",t[18]);let y={id:t[8]};void 0!==t[1]&&(y.value=t[1]),a=new t[6]({props:y}),binding_callbacks.push(()=>bind(a,"value",$)),a.$on("input",t[12]),d=new DeleteIcon({props:{size:"18"}});let b=t[22]?.length&&create_if_block_2$9(t),v=t[0]?.length&&create_if_block$q(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),o=element("div"),i=text("Suchen: "),create_component(a.$$.fragment),c=space(),l=element("span"),create_component(d.$$.fragment),u=space(),h=element("div"),m=element("table"),b&&b.c(),f=space(),p=element("tbody"),v&&v.c(),attr(e,"class","form--buttons svelte-14hcfjl"),attr(l,"class","feather pointer svelte-14hcfjl"),set_style(o,"margin-bottom","1em"),set_style(o,"position","relative"),attr(m,"striped",""),attr(m,"class","svelte-14hcfjl"),attr(h,"class","eList svelte-14hcfjl")},m(s,$){insert(s,e,$),mount_component(n,e,null),insert(s,r,$),insert(s,o,$),append(o,i),mount_component(a,o,null),append(o,c),append(o,l),mount_component(d,l,null),insert(s,u,$),insert(s,h,$),append(h,m),b&&b.m(m,null),append(m,f),append(m,p),v&&v.m(p,null),_=!0,g||(w=listen(l,"click",t[14]),g=!0)},p(t,e){get_then_context$2(t);const r={};2&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const o={};!s&&2&e[0]&&(s=!0,o.value=t[1],add_flush_callback(()=>s=!1)),a.$set(o),t[22]?.length&&b.p(t,e),t[0]?.length&&v.p(t,e)},i(t){_||(transition_in(n.$$.fragment,t),transition_in(a.$$.fragment,t),transition_in(d.$$.fragment,t),_=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a.$$.fragment,t),transition_out(d.$$.fragment,t),_=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),t&&detach(o),destroy_component(a),destroy_component(d),t&&detach(u),t&&detach(h),b&&b.d(),v&&v.d(),g=!1,w()}}}function create_default_slot_1$7(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_2$9(t){let e,n,r=t[22],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_2$4(get_each_context_2$4(t,r,e));return{c(){e=element("thead"),n=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();attr(n,"class","svelte-14hcfjl"),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n);for(let t=0;t<o.length;t+=1)o[t].m(n,null)},p(t,e){if(2048&e[0]){let i;for(r=t[22],i=0;i<r.length;i+=1){const a=get_each_context_2$4(t,r,i);o[i]?o[i].p(a,e):(o[i]=create_each_block_2$4(a),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=r.length}},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_2$4(t){let e,n,r=t[27]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$q(t){let e,n=t[0],r=[];for(let e=0;e<n.length;e+=1)r[e]=create_each_block$9(get_each_context$9(t,n,e));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,n){for(let e=0;e<r.length;e+=1)r[e].m(t,n);insert(t,e,n)},p(t,o){if(11778&o[0]){let i;for(n=t[0],i=0;i<n.length;i+=1){const a=get_each_context$9(t,n,i);r[i]?r[i].p(a,o):(r[i]=create_each_block$9(a),r[i].c(),r[i].m(e.parentNode,e))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){destroy_each(r,t),t&&detach(e)}}}function create_if_block_1$f(t){let e,n,r=t[22],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_1$6(get_each_context_1$6(t,r,e));return{c(){e=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();n=space(),attr(e,"class","pointer svelte-14hcfjl")},m(t,r){insert(t,e,r);for(let t=0;t<o.length;t+=1)o[t].m(e,null);append(e,n)},p(t,i){if(3584&i[0]){let a;for(r=t[22],a=0;a<r.length;a+=1){const s=get_each_context_1$6(t,r,a);o[a]?o[a].p(s,i):(o[a]=create_each_block_1$6(s),o[a].c(),o[a].m(e,n))}for(;a<o.length;a+=1)o[a].d(1);o.length=r.length}},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_1$6(t){let e,n,r,o,i=t[9](t[24],t[27])+"";return{c(){e=element("td"),n=text(i),attr(e,"class","svelte-14hcfjl")},m(i,a){insert(i,e,a),append(e,n),r||(o=listen(e,"click",stop_propagation(t[10](t[24]))),r=!0)},p(e,n){t=e},d(t){t&&detach(e),r=!1,o()}}}function create_each_block$9(t){let e,n=t[13](t[24],t[22],t[1]),r=n&&create_if_block_1$f(t);return{c(){r&&r.c(),e=empty()},m(t,n){r&&r.m(t,n),insert(t,e,n)},p(t,o){2&o[0]&&(n=t[13](t[24],t[22],t[1])),n?r?r.p(t,o):(r=create_if_block_1$f(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){r&&r.d(t),t&&detach(e)}}}function create_pending_block$7(t){let e,n;return e=new t[5]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$c(t){let e,n,r,o;e=new t[4]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$7,then:create_then_block$7,catch:create_catch_block$7,value:23,blocks:[,,,]};return handle_promise(t[11](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$u(t){let e,n;return e=new t[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[create_default_slot$c]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2&n[0]|2&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$u(t,e,n){const r=createEventDispatcher(),{Dialog:o,Divider:i,Loading:a,TextField:s,Button:c}=getAttractions;let{item:l}=e,{className:d}=e,{classId:u}=e,{list:h}=e,m="",f=u+Math.floor(9e3*Math.random()+1e3).toString()+"search";const p=(t,e)=>{if(!e)return;const n=t[e.name];return"boolean"==typeof n?checkBoolean(n):checkDate(t[`_${e.name}`]||t[e.name]||"")},_=Request.getSchemaByClass(d);onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(f)?.focus()},200)});return t.$$set=t=>{"item"in t&&n(15,l=t.item),"className"in t&&n(16,d=t.className),"classId"in t&&n(17,u=t.classId),"list"in t&&n(0,h=t.list)},[h,m,r,o,i,a,s,c,f,p,t=>()=>r("choose",{row:t}),async()=>{const t=await _,e=t.display;let n=await getDisplayItems(e,t,h);return{list:h,items:n}},({detail:{value:t}})=>{n(1,m=t)},(t,e,n)=>{if(!n)return!0;for(const r of e)if(p(t,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{n(1,m="")},l,d,u,()=>r("back"),function(t){m=t,n(1,m)}]}class ViewList3 extends SvelteComponent{constructor(t){super(),document_1$b.getElementById("svelte-14hcfjl-style")||add_css$q(),init(this,t,instance$u,create_fragment$u,safe_not_equal,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:document_1$a}=globals;function add_css$p(){var t=element("style");t.id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",append(document_1$a.head,t)}function get_each_context$8(t,e,n){const r=t.slice();return r[11]=e[n],r}function get_each_context_1$5(t,e,n){const r=t.slice();return r[3]=e[n],r}function create_catch_block$6(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$6(t){let e,n,r,o=t[7].items,i=[];for(let e=0;e<o.length;e+=1)i[e]=create_each_block_1$5(get_each_context_1$5(t,o,e));const a=t=>transition_out(i[t],1,1,()=>{i[t]=null});let s=t[7].list&&create_if_block_1$e(t);return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=space(),s&&s.c(),n=empty()},m(t,o){for(let e=0;e<i.length;e+=1)i[e].m(t,o);insert(t,e,o),s&&s.m(t,o),insert(t,n,o),r=!0},p(t,r){if(30327783&r[0]){let n;for(o=t[7].items,n=0;n<o.length;n+=1){const a=get_each_context_1$5(t,o,n);i[n]?(i[n].p(a,r),transition_in(i[n],1)):(i[n]=create_each_block_1$5(a),i[n].c(),transition_in(i[n],1),i[n].m(e.parentNode,e))}for(group_outros(),n=o.length;n<i.length;n+=1)a(n);check_outros()}t[7].list?s?(s.p(t,r),128&r[0]&&transition_in(s,1)):(s=create_if_block_1$e(t),s.c(),transition_in(s,1),s.m(n.parentNode,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros())},i(t){if(!r){for(let t=0;t<o.length;t+=1)transition_in(i[t]);transition_in(s),r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)transition_out(i[t]);transition_out(s),r=!1},d(t){destroy_each(i,t),t&&detach(e),s&&s.d(t),t&&detach(n)}}}function create_if_block_3$5(t){let e,n,r,o;const i=[create_if_block_4$5,create_if_block_6$3],a=[];function s(t,e){return t[3].name!==t[14]||t[15]?"lookup"!==t[3].properties?.format?1:-1:0}return~(e=s(t))&&(n=a[e]=i[e](t)),{c(){n&&n.c(),r=empty()},m(t,n){~e&&a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?~e&&a[e].p(t,o):(n&&(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros()),~e?(n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r)):n=null)},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){~e&&a[e].d(t),t&&detach(r)}}}function create_if_block_6$3(t){let e,n;return e=new InputFormField({props:{classId:t[8],item:t[3],record:t[6],disabled:t[3].name===t[14]&&t[15]||t[0],eventId:t[5],currency:t[2],changeValue:t[9]}}),e.$on("notify",t[17]),e.$on("multi",t[18]),e.$on("defPrep",t[19]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};256&n[0]&&(r.classId=t[8]),128&n[0]&&(r.item=t[3]),64&n[0]&&(r.record=t[6]),129&n[0]&&(r.disabled=t[3].name===t[14]&&t[15]||t[0]),32&n[0]&&(r.eventId=t[5]),4&n[0]&&(r.currency=t[2]),512&n[0]&&(r.changeValue=t[9]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_4$5(t){let e,n,r,o;n=new InputFormField({props:{classId:t[8],item:t[3],record:t[6],disabled:t[0]||!!t[1],required:!0,eventId:t[5],currency:t[2],changeValue:t[9]}}),n.$on("notify",t[17]),n.$on("multi",t[18]),n.$on("defPrep",t[19]),n.$on("record",t[23]),n.$on("objRecord",t[24]);let i=t[1]&&create_if_block_5$5(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i&&i.c(),set_style(e,"padding-top",".25em"),set_style(e,"background-color","lightyellow"),set_style(e,"position","relative")},m(t,a){insert(t,e,a),mount_component(n,e,null),append(e,r),i&&i.m(e,null),o=!0},p(t,r){const o={};256&r[0]&&(o.classId=t[8]),128&r[0]&&(o.item=t[3]),64&r[0]&&(o.record=t[6]),3&r[0]&&(o.disabled=t[0]||!!t[1]),32&r[0]&&(o.eventId=t[5]),4&r[0]&&(o.currency=t[2]),512&r[0]&&(o.changeValue=t[9]),n.$set(o),t[1]?i?(i.p(t,r),2&r[0]&&transition_in(i,1)):(i=create_if_block_5$5(t),i.c(),transition_in(i,1),i.m(e,null)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){o||(transition_in(n.$$.fragment,t),transition_in(i),o=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),o=!1},d(t){t&&detach(e),destroy_component(n),i&&i.d()}}}function create_if_block_5$5(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 pointer svelte-16mo2c")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[22]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block_1$5(t){let e,n,r="list"!==t[3].type&&create_if_block_3$5(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){"list"!==t[3].type?r?(r.p(t,n),128&n[0]&&transition_in(r,1)):(r=create_if_block_3$5(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_1$e(t){let e,n,r=t[7].list,o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$8(get_each_context$8(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(485&n[0]){let a;for(r=t[7].list,a=0;a<r.length;a+=1){const i=get_each_context$8(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$8(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block_2$8(t){let e,n,r,o;return e=new t[12]({props:{text:t[11].designation}}),r=new InputObject({props:{classId:t[8],list:t[11],eventId:t[5],schema:t[11].item,record:t[6],disabled:t[0],currency:t[2],update:!0}}),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};128&n[0]&&(o.text=t[11].designation),e.$set(o);const i={};256&n[0]&&(i.classId=t[8]),128&n[0]&&(i.list=t[11]),32&n[0]&&(i.eventId=t[5]),128&n[0]&&(i.schema=t[11].item),64&n[0]&&(i.record=t[6]),1&n[0]&&(i.disabled=t[0]),4&n[0]&&(i.currency=t[2]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_each_block$8(t){let e,n,r="array"!==t[11].type&&create_if_block_2$8(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){"array"!==t[11].type?r?(r.p(t,n),128&n[0]&&transition_in(r,1)):(r=create_if_block_2$8(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_pending_block$6(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_if_block$p(t){let e,n;return e=new ViewList3({props:{item:t[3],className:t[4],classId:t[8],list:t[11]}}),e.$on("choose",t[20]),e.$on("back",t[21]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8&n[0]&&(r.item=t[3]),16&n[0]&&(r.className=t[4]),256&n[0]&&(r.classId=t[8]),2048&n[0]&&(r.list=t[11]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$b(t){let e,n,r=t[10]&&create_if_block$p(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[10]?r?(r.p(t,n),1024&n[0]&&transition_in(r,1)):(r=create_if_block$p(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_fragment$t(t){let e,n,r,o,i,a,s={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$6,then:create_then_block$6,catch:create_catch_block$6,value:54,blocks:[,,,]};function c(e){t[30](e)}handle_promise(t[16](),s),n=new t[12]({});let l={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$b]},$$scope:{ctx:t}};return void 0!==t[10]&&(l.open=t[10]),o=new t[13]({props:l}),binding_callbacks.push(()=>bind(o,"open",c)),{c(){s.block.c(),e=space(),create_component(n.$$.fragment),r=space(),create_component(o.$$.fragment)},m(t,i){s.block.m(t,s.anchor=i),s.mount=()=>e.parentNode,s.anchor=e,insert(t,e,i),mount_component(n,t,i),insert(t,r,i),mount_component(o,t,i),a=!0},p(e,n){update_await_block_branch(s,t=e,n);const r={};3352&n[0]|268435456&n[1]&&(r.$$scope={dirty:n,ctx:t}),!i&&1024&n[0]&&(i=!0,r.open=t[10],add_flush_callback(()=>i=!1)),o.$set(r)},i(t){a||(transition_in(s.block),transition_in(n.$$.fragment,t),transition_in(o.$$.fragment,t),a=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(s.blocks[t])}transition_out(n.$$.fragment,t),transition_out(o.$$.fragment,t),a=!1},d(t){s.block.d(t),s.token=null,s=null,t&&detach(e),destroy_component(n,t),t&&detach(r),destroy_component(o,t)}}}function instance$t(t,e,n){const{Divider:r,FormField:o,Modal:i}=getAttractions,a=createEventDispatcher();let s,c,l,d,u,{required:h}=e,{disabled:m}=e,{readonly:f}=e,{id:p}=e,{item:_}=e,{value:g}=e,{refValue:w}=e,{currency:$}=e,y={},b=[],v=[],I={},C=new Map,E=!1,A="";const S=_.checkOn,k=g,T=t=>{s.items.filter(e=>"object"==typeof(e.properties&&e.properties[t])).map(e=>{const n=e.properties[t].refItem||"",[r,o]=n.split(".");b.push({action:t,itemName:e.name,refObj:r,refName:o,op:e.properties[t].invert?"!":""})})},R=()=>{s.items.filter(t=>t.lookup).forEach(t=>{v.push({name:t.name,lookup:t.lookup})}),s.items.filter(t=>t.properties?.lookup).forEach(t=>{v.push({name:t.name,lookup:t.properties.lookup.split(":").at(-1)})})},N=async t=>{const e=b.filter(e=>e.refObj===t);if(e?.length){n(9,I={});for(const t of e){const{itemName:e,refObj:r,refName:o,op:i}=t;let{action:a}=t;if(!r)break;let s,l,d=!o&&y[r];const u=y[r];u&&o&&(d=(await getTaskFull(r,u))[o]),Array.isArray(d)&&0===d.length&&(d=!1),"!"===i&&(d=!d),"required"!==a&&"readonly"!==a||(a="required"===a?a:"disabled",setTimeout(()=>{s=`#${c} .form-field.${e} .field textarea`,l=document.querySelector(s),l||(s=`#${c} .form-field.${e} .field input`,l=document.querySelector(s)),l&&d&&l.setAttribute(a,""),l&&!d&&l.removeAttribute(a)},0)),"hidden"===a&&(s=`#${c} .form-field.${e}`,l=document.querySelector(s),l?.classList?.toggle("hidden",!!d),d&&n(9,I[e]="",I))}}};onMount(()=>{D()});const D=async()=>{const t=t=>new Promise(e=>setTimeout(e,t));let e,n=0;for(;!(e=document.getElementById(c))&&++n<20;)await t(50);e&&((()=>{if(recID)return;const t=new Set;for(const e of b)t.add(e.refObj||l);Array.from(t).forEach(t=>N(t))})(),x())},x=()=>{setTimeout(()=>{Array.from(C).forEach(([t,e])=>{y[t]||n(6,y[t]=e._id,y)})},250)},O=async t=>{if(!t.value)return void P();const e={[t.itemName]:{$regex:`(?i)${t.value}`}},r=await Request.getSectionView(l,e);r?.length?(n(11,A=r),n(10,E=!0)):(n(1,g=""),n(25,w=""),a("setRefValue",w))},M=()=>{n(10,E=!1)},P=()=>{n(1,g=""),n(25,w=g),n(6,y={}),a("setRefValue",w)};return t.$$set=t=>{"required"in t&&n(26,h=t.required),"disabled"in t&&n(0,m=t.disabled),"readonly"in t&&n(27,f=t.readonly),"id"in t&&n(28,p=t.id),"item"in t&&n(3,_=t.item),"value"in t&&n(1,g=t.value),"refValue"in t&&n(25,w=t.refValue),"currency"in t&&n(2,$=t.currency)},t.$$.update=()=>{134217729&t.$$.dirty[0]&&n(0,m=m||f),536871024&t.$$.dirty[0]&&y&&a("safeReference",{record:y,class:l,event:d,taskId:u})},[m,g,$,_,l,d,y,s,c,I,E,A,r,i,S,k,async()=>{try{if(g){const t=await Request.getTask(_.refClass,g);delete t._task,n(6,y=t),n(29,u=(await Request.getTaskByDocId(t._id,!0))._id)}else n(6,y={})}catch{}return n(7,s=await Request.getSchemaByClass(_.refClass)),n(8,c="form-"+s.class+Math.floor(9e3*Math.random()+1e3).toString()),n(4,l=s.class),s.identity.designation,n(5,d=s.id),["readonly","hidden","required"].map(T),R(),!0},async({detail:t})=>{const{itemName:e,value:r}=t;if(n(6,y[e]=r,y),e===S)return O(t);N(e)},async({detail:t})=>{if(!(s.input?.length&&s.input.length>1))return;if(prevSchema?.class!==s.input[0])return;const{value:e,lookup:r,view:o}=t,[i]=r.split(":"),a=(await Request.getSectionView(i,{[o]:{$in:e}})).map(t=>t._id);for(const t of s.input.slice(1)){n(6,y[t]=[],y);const e=await Request.getSchemaByClass(t);e.id;let r=await Request.getTasks(e.id);if(r=r.data.filter(t=>"Ready"===t._task?.status&&a.includes(t[i])),r?.length){const e=r.map(t=>t._id),o=await Request.getSectionView(t,{_id:{$in:e}});for(const e of o)e[t]=e._id;n(6,y[t]=o,y)}}},async({detail:{className:t,itemName:e,value:n}})=>{if(C.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===l)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&C.set(t,o[0])},async({detail:t})=>{const e=await Request.getSectionView(l,{_id:t.row._id});e?.length&&(n(1,g=e[0]._id),n(25,w=g),a("setRefValue",w),n(6,y=e[0])),M()},M,P,({detail:t})=>{n(6,y[t.itemName]=t.value,y)},({detail:t})=>{for(const e of t.items)n(6,y[t.listName][e.name]=e.value,y)},w,h,f,p,u,function(t){E=t,n(10,E)}]}class InputObjectReference extends SvelteComponent{constructor(t){super(),document_1$a.getElementById("svelte-16mo2c-style")||add_css$p(),init(this,t,instance$t,create_fragment$t,safe_not_equal,{required:26,disabled:0,readonly:27,id:28,item:3,value:1,refValue:25,currency:2},[-1,-1])}}function add_css$o(){var t=element("style");t.id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",append(document.head,t)}function create_if_block_1$d(t){let e,n;return{c(){e=element("span"),n=text(t[4]),attr(e,"class","item")},m(t,r){insert(t,e,r),append(e,n)},p(t,e){16&e[0]&&set_data(n,t[4])},d(t){t&&detach(e)}}}function create_if_block$o(t){let e,n,r,o,i;return n=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Übernehmen"),attr(e,"class","pointer feather svelte-1fuww0c")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[17]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_default_slot$a(t){let e,n,r,o=t[6]&&create_if_block_1$d(t),i=t[14]&&create_if_block$o(t);return{c(){o&&o.c(),e=space(),i&&i.c(),n=empty()},m(t,a){o&&o.m(t,a),insert(t,e,a),i&&i.m(t,a),insert(t,n,a),r=!0},p(t,n){t[6]?o?o.p(t,n):(o=create_if_block_1$d(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),t[14]&&i.p(t,n)},i(t){r||(transition_in(i),r=!0)},o(t){transition_out(i),r=!1},d(t){o&&o.d(t),t&&detach(e),i&&i.d(t),t&&detach(n)}}}function create_fragment$s(t){let e,n,r;return n=new t[10]({props:{withItem:!0,itemLeft:!0,lang:t[11].id,class:"left",type:"string",inputClass:"txt-right"+(t[1]?"":" "+t[2]),id:t[0],name:t[0],value:t[9],step:t[12],pattern:t[7],placeholder:t[13],readonly:t[8],disabled:t[3],required:t[5],$$slots:{default:[create_default_slot$a]},$$scope:{ctx:t}}}),n.$on("change",t[15]),n.$on("focus",t[16]),{c(){e=element("div"),create_component(n.$$.fragment),set_style(e,"position","relative"),set_style(e,"max-width","10em")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(t,e){const r={};6&e[0]&&(r.inputClass="txt-right"+(t[1]?"":" "+t[2])),1&e[0]&&(r.id=t[0]),1&e[0]&&(r.name=t[0]),512&e[0]&&(r.value=t[9]),128&e[0]&&(r.pattern=t[7]),256&e[0]&&(r.readonly=t[8]),8&e[0]&&(r.disabled=t[3]),32&e[0]&&(r.required=t[5]),80&e[0]|32&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function instance$s(t,e,n){const r=createEventDispatcher(),{TextField:o}=getAttractions;let{id:i}=e,{item:a}=e,{value:s}=e,{noForm:c=!1}=e,{classId:l}=e,{disabled:d}=e,{formnovalidate:u}=e,{currency:h}=e,{praefix:m}=e,{notifyList:f}=e;const p=JSON.parse(Storage.getItem("Locale"));let _=["price","amount","amountValue","taxValue","total","__total"].find(t=>t===a.name?.split("-")[0])||a.properties?.currency;!1===a.properties?.currency&&(_=!1);const g=Number("1.1").toLocaleString(p.id).substring(1,2),{properties:w={}}=a;let{min:$,max:y,step:b,pattern:v,decimals:I=0,unit:C="",placeholder:E,hint:A,readonly:S,negative:k,required:T=!1,transfer:R}=w,N="";s=s?Number(s.toString().replace(",",".")):0,S=!0===S||void 0;const D=t=>Number(t.toString()).toFixed(I).toString().replace(".",g);v||(v=I?`[0-9]+([${g}][0-9]{1,${I}})?`:"[0-9]*"),k&&(v="-?"+v);return t.$$set=t=>{"id"in t&&n(0,i=t.id),"item"in t&&n(19,a=t.item),"value"in t&&n(18,s=t.value),"noForm"in t&&n(1,c=t.noForm),"classId"in t&&n(2,l=t.classId),"disabled"in t&&n(3,d=t.disabled),"formnovalidate"in t&&n(20,u=t.formnovalidate),"currency"in t&&n(4,h=t.currency),"praefix"in t&&n(21,m=t.praefix),"notifyList"in t&&n(22,f=t.notifyList)},t.$$.update=()=>{1048608&t.$$.dirty[0]&&n(5,T=T&&!u),262144&t.$$.dirty[0]&&(t=>{n(9,N=D(t.toString().replace(",",".")))})(s),4194304&t.$$.dirty[0]&&(async()=>{const t=a.properties?.value?.formula;if(t)void 0!==m&&""!==m?t?.operator?.multiply&&r("formula",{item:a}):t?.operator&&r("formula",{item:a})})()},[i,c,l,d,h,T,_,v,S,N,o,p,b,E,R,({detail:t})=>r("blur",{value:D(t.value)}),({detail:t})=>{S||+s||n(9,N="")},({detail:t})=>{const e=[].concat(R.target);for(const t of e)r("record",{itemName:t,value:s}),r("listRecord",{itemName:t,decimals:a.properties?.decimals,value:s})},s,a,u,m,f]}class InputNumber extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-1fuww0c-style")||add_css$o(),init(this,t,instance$s,create_fragment$s,safe_not_equal,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:4,praefix:21,notifyList:22},[-1,-1])}}const{document:document_1$9}=globals;function add_css$n(){var t=element("style");t.id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",append(document_1$9.head,t)}function get_then_context$1(t){t[34]=t[36].list,t[35]=t[36].items}function get_each_context$7(t,e,n){const r=t.slice();return r[37]=e[n],r[39]=n,r}function get_each_context_1$4(t,e,n){const r=t.slice();return r[40]=e[n],r[42]=n,r}function get_each_context_2$3(t,e,n){const r=t.slice();return r[40]=e[n],r}function create_catch_block$5(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$5(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$;get_then_context$1(t),n=new t[9]({props:{outline:!0,$$slots:{default:[create_default_slot_2$4]},$$scope:{ctx:t}}}),n.$on("click",t[31]);let y=!t[2]&&create_if_block_5$4(t);function b(e){t[32](e)}let v={id:t[12]};void 0!==t[3]&&(v.value=t[3]),s=new t[7]({props:v}),binding_callbacks.push(()=>bind(s,"value",b)),s.$on("input",t[15]),u=new DeleteIcon({props:{size:"18"}});let I=t[35]?.length&&create_if_block_3$4(t),C=t[34]?.length&&create_if_block$n(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),y&&y.c(),o=space(),i=element("div"),a=text("Suchen: "),create_component(s.$$.fragment),l=space(),d=element("span"),create_component(u.$$.fragment),h=space(),m=element("div"),f=element("table"),I&&I.c(),p=space(),_=element("tbody"),C&&C.c(),attr(e,"class","form--buttons svelte-1m010ne"),attr(d,"class","feather pointer svelte-1m010ne"),set_style(i,"margin-bottom","1em"),set_style(i,"position","relative"),attr(f,"striped",""),attr(f,"class","svelte-1m010ne"),attr(m,"class","eList svelte-1m010ne")},m(c,b){insert(c,e,b),mount_component(n,e,null),append(e,r),y&&y.m(e,null),insert(c,o,b),insert(c,i,b),append(i,a),mount_component(s,i,null),append(i,l),append(i,d),mount_component(u,d,null),insert(c,h,b),insert(c,m,b),append(m,f),I&&I.m(f,null),append(f,p),append(f,_),C&&C.m(_,null),g=!0,w||($=listen(d,"click",t[17]),w=!0)},p(t,r){get_then_context$1(t);const o={};16384&r[1]&&(o.$$scope={dirty:r,ctx:t}),n.$set(o),t[2]?y&&(group_outros(),transition_out(y,1,1,()=>{y=null}),check_outros()):y?(y.p(t,r),4&r[0]&&transition_in(y,1)):(y=create_if_block_5$4(t),y.c(),transition_in(y,1),y.m(e,null));const i={};!c&&8&r[0]&&(c=!0,i.value=t[3],add_flush_callback(()=>c=!1)),s.$set(i),t[35]?.length&&I.p(t,r),t[34]?.length&&C.p(t,r)},i(t){g||(transition_in(n.$$.fragment,t),transition_in(y),transition_in(s.$$.fragment,t),transition_in(u.$$.fragment,t),transition_in(I),transition_in(C),g=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(y),transition_out(s.$$.fragment,t),transition_out(u.$$.fragment,t),transition_out(I),transition_out(C),g=!1},d(t){t&&detach(e),destroy_component(n),y&&y.d(),t&&detach(o),t&&detach(i),destroy_component(s),destroy_component(u),t&&detach(h),t&&detach(m),I&&I.d(),C&&C.d(),w=!1,$()}}}function create_default_slot_2$4(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_5$4(t){let e,n;return e=new t[9]({props:{disabled:!t[34].length,filled:!0,$$slots:{default:[create_default_slot_1$6]},$$scope:{ctx:t}}}),e.$on("click",t[18](t[34])),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16384&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$6(t){let e;return{c(){e=text("Bestätigen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_3$4(t){let e,n,r,o,i=!t[2]&&create_if_block_4$4(t),a=t[35],s=[];for(let e=0;e<a.length;e+=1)s[e]=create_each_block_2$3(get_each_context_2$3(t,a,e));return{c(){e=element("thead"),n=element("tr"),i&&i.c(),r=space();for(let t=0;t<s.length;t+=1)s[t].c();attr(n,"class","svelte-1m010ne"),attr(e,"class","svelte-1m010ne")},m(t,a){insert(t,e,a),append(e,n),i&&i.m(n,null),append(n,r);for(let t=0;t<s.length;t+=1)s[t].m(n,null);o=!0},p(t,e){if(t[2]?i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros()):i?(i.p(t,e),4&e[0]&&transition_in(i,1)):(i=create_if_block_4$4(t),i.c(),transition_in(i,1),i.m(n,r)),16384&e[0]){let r;for(a=t[35],r=0;r<a.length;r+=1){const o=get_each_context_2$3(t,a,r);s[r]?s[r].p(o,e):(s[r]=create_each_block_2$3(o),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=a.length}},i(t){o||(transition_in(i),o=!0)},o(t){transition_out(i),o=!1},d(t){t&&detach(e),i&&i.d(),destroy_each(s,t)}}}function create_if_block_4$4(t){let e,n,r,o,i;return n=new CheckCircleIcon({props:{size:"20"}}),{c(){e=element("th"),create_component(n.$$.fragment),attr(e,"class","svelte-1m010ne")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[19](t[34])),o=!0)},p(e,n){t=e},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block_2$3(t){let e,n,r=t[40]+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-1m010ne")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$n(t){let e,n,r=t[34],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$7(get_each_context$7(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(1138717&n[0]){let a;for(r=t[34],a=0;a<r.length;a+=1){const i=get_each_context$7(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$7(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block_1$c(t){let e,n,r,o,i,a,s,c=t[0],l=create_key_block$1(t),d=t[35],u=[];for(let e=0;e<d.length;e+=1)u[e]=create_each_block_1$4(get_each_context_1$4(t,d,e));return{c(){e=element("tr"),l.c(),n=space();for(let t=0;t<u.length;t+=1)u[t].c();r=space(),attr(e,"style",o=t[2]?"cursor: default;":"cursor: zoom-in;"),attr(e,"title","übernimmt den Wert direkt"),attr(e,"class","svelte-1m010ne"),toggle_class(e,"active",t[0].includes(Array.isArray(t[37])?t[37][0]:t[37]))},m(o,c){insert(o,e,c),l.m(e,null),append(e,n);for(let t=0;t<u.length;t+=1)u[t].m(e,null);append(e,r),i=!0,a||(s=listen(e,"click",t[20](t[37])),a=!0)},p(a,s){if(t=a,1&s[0]&&safe_not_equal(c,c=t[0])?(group_outros(),transition_out(l,1,1,noop),check_outros(),l=create_key_block$1(t),l.c(),transition_in(l),l.m(e,n)):l.p(t,s),16400&s[0]){let n;for(d=t[35],n=0;n<d.length;n+=1){const o=get_each_context_1$4(t,d,n);u[n]?u[n].p(o,s):(u[n]=create_each_block_1$4(o),u[n].c(),u[n].m(e,r))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!i||4&s[0]&&o!==(o=t[2]?"cursor: default;":"cursor: zoom-in;"))&&attr(e,"style",o),16385&s[0]&&toggle_class(e,"active",t[0].includes(Array.isArray(t[37])?t[37][0]:t[37]))},i(t){i||(transition_in(l),i=!0)},o(t){transition_out(l),i=!1},d(t){t&&detach(e),l.d(t),destroy_each(u,t),a=!1,s()}}}function create_if_block_2$7(t){let e,n,r;return n=new t[11]({props:{name:t[13],data:t[39],checked:t[0].includes(Array.isArray(t[37])?t[37][0]:t[37]),round:!0}}),{c(){e=element("td"),create_component(n.$$.fragment),attr(e,"title","Wählt den Wert aus"),attr(e,"class","svelte-1m010ne")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(t,e){const r={};1&e[0]&&(r.checked=t[0].includes(Array.isArray(t[37])?t[37][0]:t[37])),n.$set(r)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_key_block$1(t){let e,n,r=!t[2]&&create_if_block_2$7(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[2]?r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros()):r?(r.p(t,n),4&n[0]&&transition_in(r,1)):(r=create_if_block_2$7(t),r.c(),transition_in(r,1),r.m(e.parentNode,e))},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_each_block_1$4(t){let e,n,r=(Array.isArray(t[37])?t[37][t[42]]:t[4][t[39]]?t[4][t[39]][t[42]]:t[37])+"";return{c(){e=element("td"),n=text(r),attr(e,"class","svelte-1m010ne")},m(t,r){insert(t,e,r),append(e,n)},p(t,e){16&e[0]&&r!==(r=(Array.isArray(t[37])?t[37][t[42]]:t[4][t[39]]?t[4][t[39]][t[42]]:t[37])+"")&&set_data(n,r)},d(t){t&&detach(e)}}}function create_each_block$7(t){let e,n,r=t[16](t[37],t[3]),o=r&&create_if_block_1$c(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){8&n[0]&&(r=t[16](t[37],t[3])),r?o?(o.p(t,n),8&n[0]&&transition_in(o,1)):(o=create_if_block_1$c(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_pending_block$5(t){let e,n;return e=new t[6]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$9(t){let e,n,r,o;e=new t[10]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$5,then:create_then_block$5,catch:create_catch_block$5,value:36,blocks:[,,,]};return handle_promise(t[14](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$r(t){let e,n;return e=new t[8]({props:{title:t[1]||"Auswahl",class:"eList",$$slots:{default:[create_default_slot$9]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2&n[0]&&(r.title=t[1]||"Auswahl"),29&n[0]|16384&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$r(t,e,n){const r=createEventDispatcher(),{Loading:o,TextField:i,Dialog:a,Button:s,Divider:c,Checkbox:l}=getAttractions;let{classId:d}=e,{id:u}=e,{designation:h}=e,{selection:m}=e,{refDoc:f}=e,{tableName:p}=e,{idName:_}=e,{target:g}=e,{view:w}=e,{unique:$}=e,{uniqueView:y}=e,{status:b}=e,{single:v}=e;m||=[];let I="",C=d+Math.floor(9e3*Math.random()+1e3).toString()+"search",E=[];const A=p+_+g+"checkbox",S=(t,e)=>t>e?1:e>t?-1:0;onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(C)?.focus()},200)});return t.$$set=t=>{"classId"in t&&n(22,d=t.classId),"id"in t&&n(23,u=t.id),"designation"in t&&n(1,h=t.designation),"selection"in t&&n(0,m=t.selection),"refDoc"in t&&n(24,f=t.refDoc),"tableName"in t&&n(25,p=t.tableName),"idName"in t&&n(26,_=t.idName),"target"in t&&n(21,g=t.target),"view"in t&&n(27,w=t.view),"unique"in t&&n(28,$=t.unique),"uniqueView"in t&&n(29,y=t.uniqueView),"status"in t&&n(30,b=t.status),"single"in t&&n(2,v=t.single)},[m,h,v,I,E,r,o,i,a,s,c,l,C,A,async()=>{let t=[],e=[],r={};if(n(4,E=[]),_)if(w){if(u){const e=d.split("-")[1].slice(0,-4),n="input."+d+"[name='_id']",o=document.querySelector(n).value;r={[_]:u},b&&(r.$or=[{status:!0},{[e]:o}]),t=await Request.getSectionView(p,r),t=t.sort((t,n)=>{const r=t=>(t[e]||"z").toString()+t[g];return S(r(t),r(n))})}}else y?u&&(r={[_]:u,status:!0},Object.entries(y).map(([t,n])=>{n?.length&&(r[t]={$in:n}),e.push(t)}),t=await Request.getSectionView(p,r),t=t.sort((t,e)=>{const n=t=>(m.includes(t[g])?"0-":"1-")+t[g];return S(n(t),n(e))}),n(4,E=t.map(t=>{const n=[t[g]];return e.map(e=>n.push(t[e])),n}))):$?(t=await Request.getSection(p,_,u,$),t=t.sort((t,e)=>S(t,e))):(t=await Request.getSection(p,_,u,!1,b),t=t.sort((t,e)=>{const n=t=>(m.includes(t[g])?"0-":"1-")+t[g];return S(n(t),n(e))}));else r={},u&&!Array.isArray(u)&&(r._id=u),t=await Request.getSectionView(p,r);const o=await Request.getSchemaByClass(p),i=[];if(f){const e=o.items[0].name,r=o.items[1].name,i=o.list[0].name,a=t.find(t=>t[e]===f);t=a?a[i]:[],n(21,g=r)}let a;return t.map(t=>{let e=t[g];if(e||p!==g||(n(21,g=o.items[0].name),e=t[g]),Array.isArray(e))for(const t of e){let e=t;"string"!=typeof t&&(e=Array.from(Object.values(t)).filter(t=>!!t&&24!==t?.length).join(", ")),i.push(e||[])}else f&&(e=o.list[0].item.map(e=>t[e.name]||"")),i.push(e||[])}),a=f?o.list[0].item.map(t=>t.designation):[o.items.find(t=>t.name===g)?.designation],e=e.map(t=>o.items.find(e=>e.name===t)?.designation),{list:f?i:i.flat(),items:[...a,...e]}},({detail:{value:t}})=>{n(3,I=t)},(t,e)=>{if(!e)return!0;return!!(Array.isArray(t)?t.join(" "):t).toLowerCase().includes(e.toLowerCase())},()=>{n(3,I="")},t=>()=>{const e=document.getElementsByName(A),n=[];e.forEach((e,r)=>{e.checked&&n.push(t[+e.attributes.data.value])}),r("choose",{list:n})},t=>()=>{document.getElementsByName(A).forEach((t,e)=>{t.checked=!t.checked})},t=>e=>{if("TD"===e.target?.nodeName){const e=Array.isArray(t)?t[0]:t;v?r("choose",{list:[].concat(e)}):(n(0,m=m.includes(e)?m.filter(t=>t!==e):m.concat(e)),r("choose",{list:m}))}},g,d,u,f,p,_,w,$,y,b,()=>r("back"),function(t){I=t,n(3,I)}]}class ComposedList extends SvelteComponent{constructor(t){super(),document_1$9.getElementById("svelte-1m010ne-style")||add_css$n(),init(this,t,instance$r,create_fragment$r,safe_not_equal,{classId:22,id:23,designation:1,selection:0,refDoc:24,tableName:25,idName:26,target:21,view:27,unique:28,uniqueView:29,status:30,single:2},[-1,-1])}}const{document:document_1$8}=globals;function add_css$m(){var t=element("style");t.id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",append(document_1$8.head,t)}function create_if_block_5$3(t){let e,n,r,o,i,a=t[7].length+"";return{c(){e=element("span"),n=text("("),r=text(a),o=text(")"),attr(e,"class",i=null_to_empty(t[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,n){128&n[0]&&a!==(a=t[7].length+"")&&set_data(r,a),2&n[0]&&i!==(i=null_to_empty(t[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&attr(e,"class",i)},d(t){t&&detach(e)}}}function create_load_more_options_message_slot$1(t){let e;return{c(){e=element("div"),attr(e,"class","load-more-options"),attr(e,"slot","load-more-options-message")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_1$b(t){let e,n,r,o;const i=[create_if_block_2$6,create_if_block_3$3,create_if_block_4$3],a=[];function s(t,e){return!t[16].single&&t[7]?.length?0:t[17]?1:t[14]&&t[16].view&&t[16].maxItem?2:-1}return~(e=s(t))&&(n=a[e]=i[e](t)),{c(){n&&n.c(),r=empty()},m(t,n){~e&&a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?~e&&a[e].p(t,o):(n&&(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros()),~e?(n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r)):n=null)},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){~e&&a[e].d(t),t&&detach(r)}}}function create_if_block_4$3(t){let e,n,r,o,i;return n=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Übernehmen"),attr(e,"class","feather pointer svelte-1rbaejz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[26]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_3$3(t){let e,n,r,o,i;return n=new CommandIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title",t[17].title||"Generieren"),attr(e,"class","feather pointer svelte-1rbaejz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[25]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_2$6(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Löschen"),attr(e,"class","feather pointer svelte-1rbaejz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[27]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block$m(t){let e,n,r;function o(e){t[37](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$8]},$$scope:{ctx:t}};return void 0!==t[10]&&(i.open=t[10]),e=new t[11]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};53&r[0]|32768&r[1]&&(o.$$scope={dirty:r,ctx:t}),!n&&1024&r[0]&&(n=!0,o.open=t[10],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot$8(t){let e,n;return e=new ComposedList({props:{classId:t[2],selection:t[0],refDoc:t[19],view:t[15],status:t[18],unique:t[16].unique&&t[4].name,uniqueView:t[16].view&&{[t[16].view]:t[5][t[16].view]},id:t[5][t[21]||t[20]],tableName:t[20],idName:t[21],designation:t[4].designation,target:t[4].name,single:t[16].single}}),e.$on("choose",t[24]),e.$on("back",t[23]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4&n[0]&&(r.classId=t[2]),1&n[0]&&(r.selection=t[0]),16&n[0]&&(r.unique=t[16].unique&&t[4].name),32&n[0]&&(r.uniqueView=t[16].view&&{[t[16].view]:t[5][t[16].view]}),32&n[0]&&(r.id=t[5][t[21]||t[20]]),16&n[0]&&(r.designation=t[4].designation),16&n[0]&&(r.target=t[4].name),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$q(t){let e,n,r,o,i,a,s,c,l,d=!t[16].single&&t[7]?.length&&create_if_block_5$3(t);function u(e){t[35](e)}function h(e){t[36](e)}let m={id:t[3],name:t[3],class:t[3],readonly:t[13],disabled:t[1],required:t[6],placeholder:t[8],getOptions:getOptions,minSearchLength:"3",$$slots:{"load-more-options-message":[create_load_more_options_message_slot$1]},$$scope:{ctx:t}};void 0!==t[7]&&(m.selection=t[7]),void 0!==t[9]&&(m.maxOptions=t[9]),r=new t[12]({props:m}),binding_callbacks.push(()=>bind(r,"selection",u)),binding_callbacks.push(()=>bind(r,"maxOptions",h)),r.$on("change",t[22]);let f=!t[1]&&create_if_block_1$b(t),p=t[10]&&create_if_block$m(t);return{c(){e=element("div"),d&&d.c(),n=space(),create_component(r.$$.fragment),a=space(),f&&f.c(),s=space(),p&&p.c(),c=empty(),set_style(e,"position","relative")},m(t,o){insert(t,e,o),d&&d.m(e,null),append(e,n),mount_component(r,e,null),append(e,a),f&&f.m(e,null),insert(t,s,o),p&&p.m(t,o),insert(t,c,o),l=!0},p(t,a){!t[16].single&&t[7]?.length?d?d.p(t,a):(d=create_if_block_5$3(t),d.c(),d.m(e,n)):d&&(d.d(1),d=null);const s={};8&a[0]&&(s.id=t[3]),8&a[0]&&(s.name=t[3]),8&a[0]&&(s.class=t[3]),2&a[0]&&(s.disabled=t[1]),64&a[0]&&(s.required=t[6]),256&a[0]&&(s.placeholder=t[8]),32768&a[1]&&(s.$$scope={dirty:a,ctx:t}),!o&&128&a[0]&&(o=!0,s.selection=t[7],add_flush_callback(()=>o=!1)),!i&&512&a[0]&&(i=!0,s.maxOptions=t[9],add_flush_callback(()=>i=!1)),r.$set(s),t[1]?f&&(group_outros(),transition_out(f,1,1,()=>{f=null}),check_outros()):f?(f.p(t,a),2&a[0]&&transition_in(f,1)):(f=create_if_block_1$b(t),f.c(),transition_in(f,1),f.m(e,null)),t[10]?p?(p.p(t,a),1024&a[0]&&transition_in(p,1)):(p=create_if_block$m(t),p.c(),transition_in(p,1),p.m(c.parentNode,c)):p&&(group_outros(),transition_out(p,1,1,()=>{p=null}),check_outros())},i(t){l||(transition_in(r.$$.fragment,t),transition_in(f),transition_in(p),l=!0)},o(t){transition_out(r.$$.fragment,t),transition_out(f),transition_out(p),l=!1},d(t){t&&detach(e),d&&d.d(),destroy_component(r),f&&f.d(),t&&detach(s),p&&p.d(t),t&&detach(c)}}}async function*getOptions(t){yield[{name:t}]}function instance$q(t,e,n){const r=createEventDispatcher(),{Modal:o,Autocomplete:i}=getAttractions;let{classId:a}=e,{id:s}=e,{item:c}=e,{record:l}=e,{value:d}=e,{noForm:u=!1}=e,{disabled:h}=e,{formnovalidate:m}=e,{numberInput:f}=e,{praefix:p}=e,{toDelete:_}=e,{reqQuantity:g}=e,{notifyList:w}=e;const{properties:$={}}=c;let{placeholder:y,hint:b,readonly:v,required:I=!1,lookup:C="",view:E=!1,multi:A,max:S=1e3,generate:k=!1,status:T=!0,refDoc:R}=$;const[N,D]=C.split(":");let x=!1,O=d.map&&d.map(t=>({name:t}))||[];h||=v,h&&(y="");const M=({detail:t})=>{let e=[];t.value.map(t=>{const n=t.name?.split(",");e=e.concat(n)}),n(7,O=e.map(t=>({name:t.trim()})));const o=O.map(t=>t.name);r("blur",{value:o}),r("multi",{view:A.view,lookup:C,name:c.name,value:o})};onMount(async()=>{r("multi",{view:A.view,lookup:C,name:c.name,value:d});const t=document.getElementById(s);t.classList.add(a),!v&&C&&t.addEventListener("focus",P)});const P=()=>{if(C){document.getElementById(s).blur();const t=g||S;(A.unique||O.length<t)&&n(10,x=!0)}},B=()=>{n(10,x&&=!1)},F=({detail:t})=>{const e=t.list.map(t=>Array.isArray(t)?t[0]:t);n(7,O=e.map(t=>({name:t}))),r("blur",{value:e}),r("multi",{view:A.view,lookup:C,name:c.name,value:e}),B()},L=async()=>{const t={[D]:l[D]},e=await Request.getSectionView(N,t),n=Array.from({length:e.length},(t,n)=>e[n][c.name]);F({detail:{name:c.name,list:n}})},q=(t=!1)=>{if(h||!A.required)return;const e=A.maxItem;if(!e||A.unique)return;n(9,S=!1!==t?t:g||l[e]||0);const o=O?.length!=S,i=document.getElementById(s);i?.classList?.toggle("invalid",o),r("invalid",{idx:p,value:o})};return t.$$set=t=>{"classId"in t&&n(2,a=t.classId),"id"in t&&n(3,s=t.id),"item"in t&&n(4,c=t.item),"record"in t&&n(5,l=t.record),"value"in t&&n(0,d=t.value),"noForm"in t&&n(28,u=t.noForm),"disabled"in t&&n(1,h=t.disabled),"formnovalidate"in t&&n(29,m=t.formnovalidate),"numberInput"in t&&n(30,f=t.numberInput),"praefix"in t&&n(31,p=t.praefix),"toDelete"in t&&n(32,_=t.toDelete),"reqQuantity"in t&&n(33,g=t.reqQuantity),"notifyList"in t&&n(34,w=t.notifyList)},t.$$.update=()=>{48&t.$$.dirty[0]&&l&&""===l[c.name]&&n(7,O=[]),48&t.$$.dirty[0]&&l&&Array.isArray(l[c.name])&&n(7,O=l[c.name].map(t=>({name:t}))),16&t.$$.dirty[0]|2&t.$$.dirty[1]&&_&&_===c.name&&n(7,O=[]),128&t.$$.dirty[0]&&O&&(n(0,d=O.map&&O.map(t=>t.name)||[]),q()),1073741824&t.$$.dirty[0]&&((t={})=>{const{item:e,value:n,idx:r}=t;void 0!==p&&p!==r||e&&e.name===A.maxItem&&q(n)})(f),536870976&t.$$.dirty[0]&&n(6,I=I&&!m),8&t.$$.dirty[1]&&(async t=>{if(void 0===p)return;const{itemName:e,value:o}=t||{};if(o){if(c.refItem&&c.refItem?.split(".")[0]===e){let[t,e]=c.refItem.split(".");if(Array.isArray(o)){if(t=t.slice(0,-1),!o.length)return r("record",{itemName:"quantity",value:0}),void n(7,O=[]);const i={_id:{$in:o}},a=await Request.getSectionView(t,i);let s=[];for(const t of a)t[e]&&(s=s.concat(t[e][0][c.name]));if(!s.length)return;r("record",{itemName:"quantity",value:s.length}),n(7,O=s.map(t=>({name:t}))),M({detail:{value:O}})}else{const i=await Request.getTask(t,o);if(!i||!i[e])return;const a=i[e];if(!Array.isArray(a)&&!a.length)return;const s=a[p][c.name];r("record",{itemName:"quantity",value:s?.length||0}),n(7,O=s&&s.map(t=>({name:t})))}}if(c.refItem2&&c.refItem2?.split(".")[0]===e){let[t,e]=c.refItem2.split(".");if(Array.isArray(o))if(Array.isArray(o)){if(t=t.slice(0,-1),!o.length)return r("record",{itemName:"quantity",value:0}),void n(7,O=[]);const i={_id:{$in:o}},a=await Request.getSectionView(t,i);let s=[];for(const t of a)t[e]&&(s=s.concat(t[e][0][c.name]));if(!s.length)return;r("record",{itemName:"quantity",value:s.length}),n(7,O=s.map(t=>({name:t}))),M({detail:{value:O}})}else{const i=await Request.getTask(t,o);if(!i||!i[e])return;const a=i[e];if(!Array.isArray(a)&&!a.length)return;const s=a[p][c.name];r("record",{itemName:"quantity",value:s?.length||0}),n(7,O=s&&s.map(t=>({name:t})))}}setTimeout(q,250)}})(w)},[d,h,a,s,c,l,I,O,y,S,x,o,i,v,C,E,A,k,T,R,N,D,M,B,F,()=>{const t=l[k.itemQuantity]||g;if(!t)return;const e=k.prefix||"",n=l[k.variable]||"",r=k.len||5,o=Array.from({length:t},(t,o)=>e+n+"-"+o.toString().padStart(r,"0"));F({detail:{name:c.name,list:o}})},async()=>{if(!0===E)return L();const t=g||l[A.maxItem];if(!t)return;let e={};D&&(e={[D]:l[D]}),T&&(e.status=!0);const n=[].concat(l[A.view]||[]);n.length&&(e[A.view]={$in:n});const r=await Request.getSectionView(N,e),o=Array.from({length:t<r.length?t:r.length},(t,e)=>r[e][c.name]);F({detail:{name:c.name,list:o}})},()=>{F({detail:{name:c.name,list:[]}})},u,m,f,p,_,g,w,function(t){O=t,n(7,O),n(5,l),n(4,c),n(32,_)},function(t){S=t,n(9,S)},function(t){x=t,n(10,x)}]}class InputMulti extends SvelteComponent{constructor(t){super(),document_1$8.getElementById("svelte-1rbaejz-style")||add_css$m(),init(this,t,instance$q,create_fragment$q,safe_not_equal,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}function add_css$l(){var t=element("style");t.id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",append(document.head,t)}function create_else_block$e(t){let e,n,r;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-9up2nn")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block$l(t){let e,n,r,o,i;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-9up2nn")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[9]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$p(t){let e,n,r,o,i,a;n=new t[8]({props:{inputClass:t[0],disabled:t[1],formnovalidate:t[2],readonly:t[3],required:t[4],id:t[5],name:t[6],value:t[7]}}),n.$on("change",t[12]);const s=[create_if_block$l,create_else_block$e],c=[];function l(t,e){return t[7]?0:1}return o=l(t),i=c[o]=s[o](t),{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i.c(),set_style(e,"position","relative")},m(t,i){insert(t,e,i),mount_component(n,e,null),append(e,r),c[o].m(e,null),a=!0},p(t,[r]){const a={};1&r&&(a.inputClass=t[0]),2&r&&(a.disabled=t[1]),4&r&&(a.formnovalidate=t[2]),8&r&&(a.readonly=t[3]),16&r&&(a.required=t[4]),32&r&&(a.id=t[5]),64&r&&(a.name=t[6]),128&r&&(a.value=t[7]),n.$set(a);let d=o;o=l(t),o===d?c[o].p(t,r):(group_outros(),transition_out(c[d],1,1,()=>{c[d]=null}),check_outros(),i=c[o],i?i.p(t,r):(i=c[o]=s[o](t),i.c()),transition_in(i,1),i.m(e,null))},i(t){a||(transition_in(n.$$.fragment,t),transition_in(i),a=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),a=!1},d(t){t&&detach(e),destroy_component(n),c[o].d()}}}const getMapLink=exports("getMapLink",async t=>{const{street:e,houseNo:n,postcode:r,location:o,country:i}=t,a=[e&&n?e+" "+n:e,r&&o?r+" "+o:r||o||"",i&&(await Request.getTask("country",i)).designation].filter(t=>!!t).join(", ");return"https://bing.com/maps/default.aspx?where1="+encodeURIComponent(a)});function instance$p(t,e,n){const{TextField:r}=getAttractions;let{inputClass:o}=e,{disabled:i}=e,{formnovalidate:a}=e,{readonly:s}=e,{required:c}=e,{id:l}=e,{name:d}=e,{value:u}=e,{record:h}=e,{item:m}=e;return t.$$set=t=>{"inputClass"in t&&n(0,o=t.inputClass),"disabled"in t&&n(1,i=t.disabled),"formnovalidate"in t&&n(2,a=t.formnovalidate),"readonly"in t&&n(3,s=t.readonly),"required"in t&&n(4,c=t.required),"id"in t&&n(5,l=t.id),"name"in t&&n(6,d=t.name),"value"in t&&n(7,u=t.value),"record"in t&&n(10,h=t.record),"item"in t&&n(11,m=t.item)},[o,i,a,s,c,l,d,u,r,async()=>{if(!u)return;const t=d.includes(".")?h[d.split(".")[0]]:h,e=await getMapLink(t);window.open(e,"_blank")},h,m,function(e){bubble(t,e)}]}class InputMap extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-9up2nn-style")||add_css$l(),init(this,t,instance$p,create_fragment$p,safe_not_equal,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:document_1$7}=globals;function add_css$k(){var t=element("style");t.id="svelte-wpjws5-style",t.textContent=".feather.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:light-gray;margin-left:-2em}.inputAutoComplete .autocomplete .chip,.inputAutoComplete .autocomplete .shown-on-focus{display:none !important}",append(document_1$7.head,t)}function create_load_more_options_message_slot(t){let e;return{c(){e=element("div"),attr(e,"class","load-more-options"),attr(e,"slot","load-more-options-message")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block$k(t){let e,n,r,o;const i=[create_if_block_1$a,create_else_block$d],a=[];function s(t,e){return t[0]?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_else_block$d(t){let e,n,r;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-wpjws5")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block_1$a(t){let e,n,r,o,i;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-wpjws5")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[8]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$o(t){let e,n,r,o,i,a,s;function c(e){t[17](e)}function l(e){t[18](e)}function d(e){t[19](e)}let u={id:t[1],name:t[1],class:t[1],minSearchLength:"1",maxOptions:"1",getOptions:t[7],$$slots:{"load-more-options-message":[create_load_more_options_message_slot]},$$scope:{ctx:t}};void 0!==t[0]&&(u.value=t[0]),void 0!==t[2]&&(u.selection=t[2]),void 0!==t[3]&&(u.searchQuery=t[3]),n=new t[4]({props:u}),binding_callbacks.push(()=>bind(n,"value",c)),binding_callbacks.push(()=>bind(n,"selection",l)),binding_callbacks.push(()=>bind(n,"searchQuery",d)),n.$on("change",t[6]);let h=t[5]&&create_if_block$k(t);return{c(){e=element("div"),create_component(n.$$.fragment),a=space(),h&&h.c(),set_style(e,"position","relative"),attr(e,"class","inputAutoComplete")},m(t,r){insert(t,e,r),mount_component(n,e,null),append(e,a),h&&h.m(e,null),s=!0},p(t,e){const a={};2&e[0]&&(a.id=t[1]),2&e[0]&&(a.name=t[1]),2&e[0]&&(a.class=t[1]),16&e[1]&&(a.$$scope={dirty:e,ctx:t}),!r&&1&e[0]&&(r=!0,a.value=t[0],add_flush_callback(()=>r=!1)),!o&&4&e[0]&&(o=!0,a.selection=t[2],add_flush_callback(()=>o=!1)),!i&&8&e[0]&&(i=!0,a.searchQuery=t[3],add_flush_callback(()=>i=!1)),n.$set(a),t[5]&&h.p(t,e)},i(t){s||(transition_in(n.$$.fragment,t),transition_in(h),s=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(h),s=!1},d(t){t&&detach(e),destroy_component(n),h&&h.d()}}}function instance$o(t,e,n){const{Autocomplete:r}=getAttractions,o=createEventDispatcher();let{classId:i}=e,{id:a}=e,{item:s}=e,{name:c}=e,{listName:l}=e,{record:d}=e,{value:u}=e,{noForm:h=!1}=e,{disabled:m}=e,{formnovalidate:f}=e;const{autocomplete:{input:p,min:_,url:g,output:w},format:$}=s.properties,y=[].concat(p),{name:b}=w,v="map"===$;let I,C=u,E=!1;onMount(()=>{const t=document.querySelector("."+s.name+" .autocomplete input");t&&(t.addEventListener("focus",k),t.addEventListener("keyup",S),t.addEventListener("keydown",A));const e=document.getElementById(a);e&&e.classList.add(i)});const A=t=>{E=8===t.keyCode||32===t.keyCode},S=t=>{8===t.keyCode&&""===C&&n(0,u="")},k=async()=>{if(_){const t=y[0].name;if((l?d[l][t]:d[t]).length!==_)return}const t=await T();if(t?.length)if(1===t.length){if(u.startsWith(t[0].name))return;n(3,C=n(0,u=t[0].name)),N(u)}else t.find(t=>(C||"").startsWith(t.name))||u||n(3,C=" ");else u||n(3,C="")},T=async(t="")=>{const e=await fetch(g+"?"+R()+"&name=%5E"+t.trim());if(!e.ok)return;const n=e.headers.get("Content-Type").split(";")[0];let r=[];try{if("text/json"===n){const t=await e.text();r=JSON.parse(t||[])}else"application/json"===n&&(r=await e.json())}catch{}return r.map(t=>({name:t[b]}))},R=()=>y.map(({name:t,refItem:e})=>`${e}=${(l?d[l][t]:d[t]).split(" ")[0]}`).join("&"),N=t=>{o("blur",{value:t})};return t.$$set=t=>{"classId"in t&&n(9,i=t.classId),"id"in t&&n(1,a=t.id),"item"in t&&n(10,s=t.item),"name"in t&&n(11,c=t.name),"listName"in t&&n(12,l=t.listName),"record"in t&&n(13,d=t.record),"value"in t&&n(0,u=t.value),"noForm"in t&&n(14,h=t.noForm),"disabled"in t&&n(15,m=t.disabled),"formnovalidate"in t&&n(16,f=t.formnovalidate)},[u,a,I,C,r,v,({detail:{value:t}})=>{t.length&&n(3,C=n(0,u=t[0].name)),n(2,I=[]),N(u)},async function*(t){if(E||u&&t.startsWith(u))return n(0,u=t),void N(u);const e=await T(t);if(!e?.length)return n(0,u=t),void N(u);1===e.length?(n(3,C=n(0,u=e[0].name)),n(2,I=[]),N(u)):yield e},async()=>{if(!u)return;const t=c.includes(".")?d[c.split(".")[0]]:d,e=await getMapLink(t);window.open(e,"_blank")},i,s,c,l,d,h,m,f,function(t){u=t,n(0,u)},function(t){I=t,n(2,I)},function(t){C=t,n(3,C)}]}class InputAutocomplete extends SvelteComponent{constructor(t){super(),document_1$7.getElementById("svelte-wpjws5-style")||add_css$k(),init(this,t,instance$o,create_fragment$o,safe_not_equal,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:document_1$6}=globals;function add_css$j(){var t=element("style");t.id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",append(document_1$6.head,t)}function get_then_context(t){t[26]=t[28].list,t[27]=t[28].items}function get_each_context$6(t,e,n){const r=t.slice();return r[29]=e[n],r}function get_each_context_1$3(t,e,n){const r=t.slice();return r[32]=e[n],r}function get_each_context_2$2(t,e,n){const r=t.slice();return r[32]=e[n],r}function create_catch_block$4(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$4(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w;function $(e){t[23](e)}get_then_context(t),n=new t[7]({props:{outline:!0,$$slots:{default:[create_default_slot_1$5]},$$scope:{ctx:t}}}),n.$on("click",t[22]);let y={id:t[8]};void 0!==t[1]&&(y.value=t[1]),a=new t[6]({props:y}),binding_callbacks.push(()=>bind(a,"value",$)),a.$on("input",t[12]),d=new DeleteIcon({props:{size:"18"}});let b=t[27]?.length&&create_if_block_2$5(t),v=t[26]?.length&&create_if_block$j(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),o=element("div"),i=text("Suchen: "),create_component(a.$$.fragment),c=space(),l=element("span"),create_component(d.$$.fragment),u=space(),h=element("div"),m=element("table"),b&&b.c(),f=space(),p=element("tbody"),v&&v.c(),attr(e,"class","form--buttons svelte-14hcfjl"),attr(l,"class","feather pointer svelte-14hcfjl"),set_style(o,"margin-bottom","1em"),set_style(o,"position","relative"),attr(m,"striped",""),attr(m,"class","svelte-14hcfjl"),attr(h,"class","eList svelte-14hcfjl")},m(s,$){insert(s,e,$),mount_component(n,e,null),insert(s,r,$),insert(s,o,$),append(o,i),mount_component(a,o,null),append(o,c),append(o,l),mount_component(d,l,null),insert(s,u,$),insert(s,h,$),append(h,m),b&&b.m(m,null),append(m,f),append(m,p),v&&v.m(p,null),_=!0,g||(w=listen(l,"click",t[14]),g=!0)},p(t,e){get_then_context(t);const r={};64&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const o={};!s&&2&e[0]&&(s=!0,o.value=t[1],add_flush_callback(()=>s=!1)),a.$set(o),t[27]?.length&&b.p(t,e),t[26]?.length&&v.p(t,e)},i(t){_||(transition_in(n.$$.fragment,t),transition_in(a.$$.fragment,t),transition_in(d.$$.fragment,t),_=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a.$$.fragment,t),transition_out(d.$$.fragment,t),_=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),t&&detach(o),destroy_component(a),destroy_component(d),t&&detach(u),t&&detach(h),b&&b.d(),v&&v.d(),g=!1,w()}}}function create_default_slot_1$5(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_2$5(t){let e,n,r=t[27],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_2$2(get_each_context_2$2(t,r,e));return{c(){e=element("thead"),n=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();attr(n,"class","svelte-14hcfjl"),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n);for(let t=0;t<o.length;t+=1)o[t].m(n,null)},p(t,e){if(2048&e[0]){let i;for(r=t[27],i=0;i<r.length;i+=1){const a=get_each_context_2$2(t,r,i);o[i]?o[i].p(a,e):(o[i]=create_each_block_2$2(a),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=r.length}},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_2$2(t){let e,n,r=t[32]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$j(t){let e,n=t[26],r=[];for(let e=0;e<n.length;e+=1)r[e]=create_each_block$6(get_each_context$6(t,n,e));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,n){for(let e=0;e<r.length;e+=1)r[e].m(t,n);insert(t,e,n)},p(t,o){if(11779&o[0]){let i;for(n=t[26],i=0;i<n.length;i+=1){const a=get_each_context$6(t,n,i);r[i]?r[i].p(a,o):(r[i]=create_each_block$6(a),r[i].c(),r[i].m(e.parentNode,e))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){destroy_each(r,t),t&&detach(e)}}}function create_if_block_1$9(t){let e,n,r=t[27],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_1$3(get_each_context_1$3(t,r,e));return{c(){e=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();n=space(),attr(e,"class","pointer svelte-14hcfjl"),toggle_class(e,"active",t[29]._id===t[0])},m(t,r){insert(t,e,r);for(let t=0;t<o.length;t+=1)o[t].m(e,null);append(e,n)},p(t,i){if(3584&i[0]){let a;for(r=t[27],a=0;a<r.length;a+=1){const s=get_each_context_1$3(t,r,a);o[a]?o[a].p(s,i):(o[a]=create_each_block_1$3(s),o[a].c(),o[a].m(e,n))}for(;a<o.length;a+=1)o[a].d(1);o.length=r.length}2049&i[0]&&toggle_class(e,"active",t[29]._id===t[0])},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_1$3(t){let e,n,r,o,i=t[9](t[29],t[32])+"";return{c(){e=element("td"),n=text(i),attr(e,"class","svelte-14hcfjl")},m(i,a){insert(i,e,a),append(e,n),r||(o=listen(e,"click",stop_propagation(t[10](t[29]))),r=!0)},p(e,n){t=e},d(t){t&&detach(e),r=!1,o()}}}function create_each_block$6(t){let e,n=t[13](t[29],t[27],t[1]),r=n&&create_if_block_1$9(t);return{c(){r&&r.c(),e=empty()},m(t,n){r&&r.m(t,n),insert(t,e,n)},p(t,o){2&o[0]&&(n=t[13](t[29],t[27],t[1])),n?r?r.p(t,o):(r=create_if_block_1$9(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){r&&r.d(t),t&&detach(e)}}}function create_pending_block$4(t){let e,n;return e=new t[5]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$7(t){let e,n,r,o;e=new t[4]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$4,then:create_then_block$4,catch:create_catch_block$4,value:28,blocks:[,,,]};return handle_promise(t[11](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$n(t){let e,n;return e=new t[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[create_default_slot$7]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};3&n[0]|64&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$n(t,e,n){const r=createEventDispatcher(),{Dialog:o,Divider:i,Loading:a,TextField:s,Button:c}=getAttractions;let{item:l}=e,{className:d}=e,{classId:u}=e,{rowId:h}=e,{viewName:m}=e,{viewValue:f}=e,{recordId:p}=e,{filter:_}=e,g="",w=u+Math.floor(9e3*Math.random()+1e3).toString()+"search";const $=(t,e)=>{if(!e)return;const n=t[e.name];return"boolean"==typeof n?checkBoolean(n):checkDate(t[`_${e.name}`]||t[e.name]||"")},y=Request.getSchemaByClass(d);onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(w)?.focus()},200)}),task_notification.subscribe(async t=>{if(!t)return;const e=await y;t.eventId===e.id&&refreshList(e.class,t.eventId)});return t.$$set=t=>{"item"in t&&n(15,l=t.item),"className"in t&&n(16,d=t.className),"classId"in t&&n(17,u=t.classId),"rowId"in t&&n(0,h=t.rowId),"viewName"in t&&n(18,m=t.viewName),"viewValue"in t&&n(19,f=t.viewValue),"recordId"in t&&n(20,p=t.recordId),"filter"in t&&n(21,_=t.filter)},[h,g,r,o,i,a,s,c,w,$,t=>()=>r("choose",{row:t}),async()=>{const t=await y,e="."+u+"#"+m;document.querySelector(e);let n={[m]:f},r=[];n[m]&&(r=await Request.getSectionView(t.class,n,!0)),_&&(r=r.filter(t=>t._id!=_));const o=t.display;return{list:r,items:await getDisplayItems(o,t,r)}},({detail:{value:t}})=>{n(1,g=t)},(t,e,n)=>{if(!n)return!0;for(const r of e)if($(t,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{n(1,g="")},l,d,u,m,f,p,_,()=>r("back"),function(t){g=t,n(1,g)}]}class ViewList2 extends SvelteComponent{constructor(t){super(),document_1$6.getElementById("svelte-14hcfjl-style")||add_css$j(),init(this,t,instance$n,create_fragment$n,safe_not_equal,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function add_css$i(){var t=element("style");t.id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",append(document.head,t)}function create_catch_block$3(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$3(t){let e,n,r,o,i;function a(e){t[21](e)}let s={id:t[2],name:t[3].name,inputClass:t[5]||t[1],disabled:t[6],formnovalidate:t[7],readonly:t[13],pattern:t[12],required:t[14],style:"padding-left:2em;"};void 0!==t[0]&&(s.value=t[0]),n=new t[10]({props:s}),binding_callbacks.push(()=>bind(n,"value",a));let c=!t[6]&&create_if_block_1$8(t);return{c(){e=element("div"),create_component(n.$$.fragment),o=space(),c&&c.c(),set_style(e,"position","relative")},m(t,r){insert(t,e,r),mount_component(n,e,null),append(e,o),c&&c.m(e,null),i=!0},p(t,o){const i={};4&o&&(i.id=t[2]),8&o&&(i.name=t[3].name),34&o&&(i.inputClass=t[5]||t[1]),64&o&&(i.disabled=t[6]),128&o&&(i.formnovalidate=t[7]),!r&&1&o&&(r=!0,i.value=t[0],add_flush_callback(()=>r=!1)),n.$set(i),t[6]?c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros()):c?(c.p(t,o),64&o&&transition_in(c,1)):(c=create_if_block_1$8(t),c.c(),transition_in(c,1),c.m(e,null))},i(t){i||(transition_in(n.$$.fragment,t),transition_in(c),i=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(c),i=!1},d(t){t&&detach(e),destroy_component(n),c&&c.d()}}}function create_if_block_1$8(t){let e,n,r,o,i;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-wbrqzu")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[17]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_pending_block$3(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_if_block$i(t){let e,n,r;function o(e){t[22](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$6]},$$scope:{ctx:t}};return void 0!==t[8]&&(i.open=t[8]),e=new t[11]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};268435994&r&&(o.$$scope={dirty:r,ctx:t}),!n&&256&r&&(n=!0,o.open=t[8],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot$6(t){let e,n;return e=new ViewList2({props:{item:t[3],className:t[3].refClass,classId:t[1],rowId:"",recordId:t[4]._id,viewName:t[15].selection,viewValue:t[9],filter:t[4]._id}}),e.$on("choose",t[18]),e.$on("back",t[19]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.item=t[3]),8&n&&(r.className=t[3].refClass),2&n&&(r.classId=t[1]),16&n&&(r.recordId=t[4]._id),512&n&&(r.viewValue=t[9]),16&n&&(r.filter=t[4]._id),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$m(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$3,then:create_then_block$3,catch:create_catch_block$3,value:27,blocks:[,,,]};handle_promise(t[16](),o);let i=t[8]&&create_if_block$i(t);return{c(){o.block.c(),e=space(),i&&i.c(),n=empty()},m(t,a){o.block.m(t,o.anchor=a),o.mount=()=>e.parentNode,o.anchor=e,insert(t,e,a),i&&i.m(t,a),insert(t,n,a),r=!0},p(e,[r]){update_await_block_branch(o,t=e,r),t[8]?i?(i.p(t,r),256&r&&transition_in(i,1)):(i=create_if_block$i(t),i.c(),transition_in(i,1),i.m(n.parentNode,n)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){r||(transition_in(o.block),transition_in(i),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}transition_out(i),r=!1},d(t){o.block.d(t),o.token=null,o=null,t&&detach(e),i&&i.d(t),t&&detach(n)}}}function instance$m(t,e,n){const{TextField:r,Modal:o}=getAttractions;let{classId:i}=e,{id:a}=e,{item:s}=e,{record:c}=e,{value:l}=e,{noForm:d=!1}=e,{disabled:u}=e,{formnovalidate:h}=e,{praefix:m}=e;const{properties:f={}}=s;let p,{pattern:_,placeholder:g,readonly:w,required:$=!1,view:y}=f,b=!1;const v=()=>{n(8,b=!1)};return t.$$set=t=>{"classId"in t&&n(1,i=t.classId),"id"in t&&n(2,a=t.id),"item"in t&&n(3,s=t.item),"record"in t&&n(4,c=t.record),"value"in t&&n(0,l=t.value),"noForm"in t&&n(5,d=t.noForm),"disabled"in t&&n(6,u=t.disabled),"formnovalidate"in t&&n(7,h=t.formnovalidate),"praefix"in t&&n(20,m=t.praefix)},[l,i,a,s,c,d,u,h,b,p,r,o,_,w,$,y,async()=>(n(9,p=c[y.selection]),!0),()=>{n(8,b=!0)},({detail:t})=>{n(0,l=t.row[y.value?y.value:"_id"]),v()},v,m,function(t){l=t,n(0,l)},function(t){b=t,n(8,b)}]}class InputView extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-wbrqzu-style")||add_css$i(),init(this,t,instance$m,create_fragment$m,safe_not_equal,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function add_css$h(){var t=element("style");t.id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}",append(document.head,t)}function get_each_context$5(t,e,n){const r=t.slice();return r[12]=e[n][0],r[13]=e[n][1],r}function create_if_block$h(t){let e;function n(t,e){return t[5]&&!0!==t[8]?create_if_block_1$7:create_else_block$c}let r=n(t),o=r(t);return{c(){o.c(),e=empty()},m(t,n){o.m(t,n),insert(t,e,n)},p(t,i){r!==(r=n(t))&&(o.d(1),o=r(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){o.d(t),t&&detach(e)}}}function create_else_block$c(t){let e;return{c(){e=element("option"),e.textContent="- ",e.selected=!0,e.__value="",e.value=e.__value},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_1$7(t){let e;return{c(){e=element("option"),e.textContent="-- Bitte wählen -- ",e.disabled=!0,e.selected=!0,e.__value="",e.value=e.__value},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_each_block$5(t){let e,n,r,o,i=t[12]+"";return{c(){e=element("option"),n=text(i),e.__value=r=t[13],e.value=e.__value,e.selected=o=t[0]==t[13]},m(t,r){insert(t,e,r),append(e,n)},p(t,a){64&a&&i!==(i=t[12]+"")&&set_data(n,i),64&a&&r!==(r=t[13])&&(e.__value=r,e.value=e.__value),65&a&&o!==(o=t[0]==t[13])&&(e.selected=o)},d(t){t&&detach(e)}}}function create_fragment$l(t){let e,n,r,o,i,a=!t[7]&&create_if_block$h(t),s=t[6],c=[];for(let e=0;e<s.length;e+=1)c[e]=create_each_block$5(get_each_context$5(t,s,e));return{c(){e=element("select"),a&&a.c(),n=empty();for(let t=0;t<c.length;t+=1)c[t].c();attr(e,"class",r=null_to_empty(t[3]||t[4])+" svelte-5xpzvo"),attr(e,"id",t[2]),attr(e,"name",t[2]),e.disabled=t[1],e.required=t[5]},m(r,s){insert(r,e,s),a&&a.m(e,null),append(e,n);for(let t=0;t<c.length;t+=1)c[t].m(e,null);o||(i=listen(e,"change",t[9]),o=!0)},p(t,[n]){if(t[7]||a.p(t,n),65&n){let r;for(s=t[6],r=0;r<s.length;r+=1){const o=get_each_context$5(t,s,r);c[r]?c[r].p(o,n):(c[r]=create_each_block$5(o),c[r].c(),c[r].m(e,null))}for(;r<c.length;r+=1)c[r].d(1);c.length=s.length}24&n&&r!==(r=null_to_empty(t[3]||t[4])+" svelte-5xpzvo")&&attr(e,"class",r),4&n&&attr(e,"id",t[2]),4&n&&attr(e,"name",t[2]),2&n&&(e.disabled=t[1]),32&n&&(e.required=t[5])},i:noop,o:noop,d(t){t&&detach(e),a&&a.d(),destroy_each(c,t),o=!1,i()}}}function instance$l(t,e,n){const r=createEventDispatcher();let{id:o}=e,{item:i}=e,{value:a}=e,{noForm:s=!1}=e,{classId:c}=e,{disabled:l}=e,{required:d}=e,{enum:u,regulation:h,readonly:m}=i.properties;u&&(u=u.map(t=>[t,t])),"businessMonth"===h&&(a||=1,u=[["Januar",1],["Februar",2],["März",3],["April",4],["Mai",5],["Juni",6],["Juli",7],["August",8],["September",9],["Oktober",10],["November",11],["Dezember",12]]),"financialAccounting"===h&&(a||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===h&&(a||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),l||=!!m,l||(l=void 0);return t.$$set=t=>{"id"in t&&n(2,o=t.id),"item"in t&&n(10,i=t.item),"value"in t&&n(0,a=t.value),"noForm"in t&&n(3,s=t.noForm),"classId"in t&&n(4,c=t.classId),"disabled"in t&&n(1,l=t.disabled),"required"in t&&n(5,d=t.required)},[a,l,o,s,c,d,u,h,m,t=>r("blur",{value:t.srcElement.value}),i]}class InputSelect extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-5xpzvo-style")||add_css$h(),init(this,t,instance$l,create_fragment$l,safe_not_equal,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function create_if_block$g(t){let e,n,r,o,i;return n=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Übernehmen"),attr(e,"class","pointer feather")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[12]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$k(t){let e,n,r,o,i,a,s,c,l;o=new t[8]({props:{id:"dp-"+t[1]+(t[2]?"-"+t[2]:""),value:t[0],readonly:t[5],required:t[7],disabled:t[6],noCalendar:t[9],closeOnSelection:!0}}),o.$on("change",t[11]);let d=t[10]&&create_if_block$g(t);return{c(){e=element("input"),r=space(),create_component(o.$$.fragment),i=space(),d&&d.c(),a=empty(),attr(e,"type","string"),attr(e,"class",n=t[3]||t[4]),attr(e,"id",t[1]),attr(e,"name",t[1]),e.hidden=!0},m(n,u){insert(n,e,u),set_input_value(e,t[0]),insert(n,r,u),mount_component(o,n,u),insert(n,i,u),d&&d.m(n,u),insert(n,a,u),s=!0,c||(l=listen(e,"input",t[18]),c=!0)},p(t,[r]){(!s||24&r&&n!==(n=t[3]||t[4]))&&attr(e,"class",n),(!s||2&r)&&attr(e,"id",t[1]),(!s||2&r)&&attr(e,"name",t[1]),1&r&&set_input_value(e,t[0]);const i={};6&r&&(i.id="dp-"+t[1]+(t[2]?"-"+t[2]:"")),1&r&&(i.value=t[0]),32&r&&(i.readonly=t[5]),128&r&&(i.required=t[7]),64&r&&(i.disabled=t[6]),o.$set(i),t[10]&&d.p(t,r)},i(t){s||(transition_in(o.$$.fragment,t),transition_in(d),s=!0)},o(t){transition_out(o.$$.fragment,t),transition_out(d),s=!1},d(t){t&&detach(e),t&&detach(r),destroy_component(o,t),t&&detach(i),d&&d.d(t),t&&detach(a),c=!1,l()}}}let preValue=new Map;function instance$k(t,e,n){const r=createEventDispatcher(),{DatePicker:o}=getAttractions;let{value:i}=e,{id:a}=e,{item:s}=e,{record:c}=e,{praefix:l}=e,{noForm:d=!1}=e,{classId:u}=e,{eventId:h}=e,{readonly:m}=e,{disabled:f}=e,{required:p}=e,{notifyList:_}=e,{dateInput:g}=e;i||(i=void 0);let w=null;const $=(void 0===l?"":l.toString())+"-"+h+"-"+s.name,y=s.properties?.noCalendar||!1,b=s.properties?.transfer,v=({detail:t})=>{try{n(0,i=applyDate(t.value,i)),void 0!==l&&preValue.set($,new Date(i.valueOf())),I(i)}catch{n(0,i=void 0)}},I=t=>{r("change",{value:new Date(t.valueOf())})};if(void 0!==l&&!i){const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);i=applyDate(e,i)}return t.$$set=t=>{"value"in t&&n(0,i=t.value),"id"in t&&n(1,a=t.id),"item"in t&&n(13,s=t.item),"record"in t&&n(14,c=t.record),"praefix"in t&&n(2,l=t.praefix),"noForm"in t&&n(3,d=t.noForm),"classId"in t&&n(4,u=t.classId),"eventId"in t&&n(15,h=t.eventId),"readonly"in t&&n(5,m=t.readonly),"disabled"in t&&n(6,f=t.disabled),"required"in t&&n(7,p=t.required),"notifyList"in t&&n(16,_=t.notifyList),"dateInput"in t&&n(17,g=t.dateInput)},t.$$.update=()=>{if(1&t.$$.dirty&&i&&!b&&preValue.has($)&&n(0,i=preValue.get($)),65536&t.$$.dirty&&(async t=>{if(null===w){const t=(await Request.getEvent(h)).output.class[0].item;w=t.find(t=>t.properties?.value?.formula)}w&&w.properties.value.formula.argument[0].refItem===s.name&&(t&&t.itemName!==s.name&&!w.properties.value.formula.argument[1].value&&t.itemName!==w.properties.value.formula.argument[1].refItem.split(".")[0]||r("formula",{item:w}))})(_),131072&t.$$.dirty&&((t={})=>{let{ref:e,val:n,t:r,l:o,n:i}=t;if(i&&(n=i),!n||isNaN(new Date(n)))return;if(r)return;if(!e)return;const[a,c]=e.split(".");a===o&&c===s.name&&null!=l&&v({detail:{value:new Date(n)}})})(g),24673&t.$$.dirty&&c&&c[s.name])try{f||m||n(0,i=applyDate(c[s.name],i))}catch{}},[i,a,l,d,u,m,f,p,o,y,b,v,()=>{r("record",{target:b.target,value:i.toISOString()})},s,c,h,_,g,function(){i=this.value,n(0,i),n(14,c),n(13,s),n(6,f),n(5,m)}]}class InputDate extends SvelteComponent{constructor(t){super(),init(this,t,instance$k,create_fragment$k,safe_not_equal,{value:0,id:1,item:13,record:14,praefix:2,noForm:3,classId:4,eventId:15,readonly:5,disabled:6,required:7,notifyList:16,dateInput:17})}}function create_default_slot_2$3(t){let e;return{c(){e=text("Stunden")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_hours_label_slot(t){let e,n;return e=new t[4]({props:{slot:"hours-label",$$slots:{default:[create_default_slot_2$3]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$4(t){let e;return{c(){e=text("Minuten")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_minutes_label_slot(t){let e,n;return e=new t[4]({props:{slot:"minutes-label",$$slots:{default:[create_default_slot_1$4]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$5(t){let e;return{c(){e=text("Jetzt")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_now_label_slot(t){let e,n;return e=new t[4]({props:{slot:"now-label",$$slots:{default:[create_default_slot$5]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$j(t){let e,n,r,o,i,a,s,c,l;return o=new t[5]({props:{value:t[0],closeOnSelection:!0}}),o.$on("change",t[8]),a=new t[6]({props:{value:t[0],$$slots:{"now-label":[create_now_label_slot],"minutes-label":[create_minutes_label_slot],"hours-label":[create_hours_label_slot]},$$scope:{ctx:t}}}),a.$on("change",t[7]),{c(){e=element("input"),r=space(),create_component(o.$$.fragment),i=space(),create_component(a.$$.fragment),attr(e,"type","string"),attr(e,"class",n=t[2]||t[3]),attr(e,"id",t[1]),attr(e,"name",t[1]),e.hidden=!0},m(n,d){insert(n,e,d),set_input_value(e,t[0]),insert(n,r,d),mount_component(o,n,d),insert(n,i,d),mount_component(a,n,d),s=!0,c||(l=listen(e,"input",t[9]),c=!0)},p(t,[r]){(!s||12&r&&n!==(n=t[2]||t[3]))&&attr(e,"class",n),(!s||2&r)&&attr(e,"id",t[1]),(!s||2&r)&&attr(e,"name",t[1]),1&r&&set_input_value(e,t[0]);const i={};1&r&&(i.value=t[0]),o.$set(i);const c={};1&r&&(c.value=t[0]),4096&r&&(c.$$scope={dirty:r,ctx:t}),a.$set(c)},i(t){s||(transition_in(o.$$.fragment,t),transition_in(a.$$.fragment,t),s=!0)},o(t){transition_out(o.$$.fragment,t),transition_out(a.$$.fragment,t),s=!1},d(t){t&&detach(e),t&&detach(r),destroy_component(o,t),t&&detach(i),destroy_component(a,t),c=!1,l()}}}function instance$j(t,e,n){const r=createEventDispatcher(),{Label:o,DatePicker:i,TimePicker:a}=getAttractions;let{value:s}=e,{id:c}=e,{noForm:l=!1}=e,{classId:d}=e;const u=t=>r("change",{value:t});return t.$$set=t=>{"value"in t&&n(0,s=t.value),"id"in t&&n(1,c=t.id),"noForm"in t&&n(2,l=t.noForm),"classId"in t&&n(3,d=t.classId)},[s,c,l,d,o,i,a,({detail:t})=>{n(0,s=applyTime(t.value,s)),u(s)},({detail:t})=>{n(0,s=applyDate(t.value,s)),u(s)},function(){s=this.value,n(0,s)}]}class InputDateTime extends SvelteComponent{constructor(t){super(),init(this,t,instance$j,create_fragment$j,safe_not_equal,{value:0,id:1,noForm:2,classId:3})}}function add_css$g(){var t=element("style");t.id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",append(document.head,t)}function create_fragment$i(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_;return u=new t[9]({props:{format:t[5],required:t[3],disabled:t[4],value:t[7],noCalendar:t[10],closeOnSelection:!0}}),u.$on("change",t[11]),m=new t[9]({props:{format:t[6],required:t[3],disabled:t[4],value:t[8],noCalendar:t[10],class:"moveLeft",closeOnSelection:!0}}),m.$on("change",t[12]),{c(){e=element("input"),i=space(),a=element("input"),d=space(),create_component(u.$$.fragment),h=text(" /\n"),create_component(m.$$.fragment),attr(e,"type","string"),attr(e,"class",n=t[1]||t[2]),attr(e,"id",r=t[0]+"_from"),attr(e,"name",o=t[0]+"_from"),e.hidden=!0,attr(a,"type","string"),attr(a,"class",s=t[1]||t[2]),attr(a,"id",c=t[0]+"_to"),attr(a,"name",l=t[0]+"_to"),a.hidden=!0},m(n,r){insert(n,e,r),set_input_value(e,t[7]),insert(n,i,r),insert(n,a,r),set_input_value(a,t[8]),insert(n,d,r),mount_component(u,n,r),insert(n,h,r),mount_component(m,n,r),f=!0,p||(_=[listen(e,"input",t[15]),listen(a,"input",t[16])],p=!0)},p(t,[i]){(!f||6&i&&n!==(n=t[1]||t[2]))&&attr(e,"class",n),(!f||1&i&&r!==(r=t[0]+"_from"))&&attr(e,"id",r),(!f||1&i&&o!==(o=t[0]+"_from"))&&attr(e,"name",o),128&i&&set_input_value(e,t[7]),(!f||6&i&&s!==(s=t[1]||t[2]))&&attr(a,"class",s),(!f||1&i&&c!==(c=t[0]+"_to"))&&attr(a,"id",c),(!f||1&i&&l!==(l=t[0]+"_to"))&&attr(a,"name",l),256&i&&set_input_value(a,t[8]);const d={};32&i&&(d.format=t[5]),8&i&&(d.required=t[3]),16&i&&(d.disabled=t[4]),128&i&&(d.value=t[7]),u.$set(d);const h={};64&i&&(h.format=t[6]),8&i&&(h.required=t[3]),16&i&&(h.disabled=t[4]),256&i&&(h.value=t[8]),m.$set(h)},i(t){f||(transition_in(u.$$.fragment,t),transition_in(m.$$.fragment,t),f=!0)},o(t){transition_out(u.$$.fragment,t),transition_out(m.$$.fragment,t),f=!1},d(t){t&&detach(e),t&&detach(i),t&&detach(a),t&&detach(d),destroy_component(u,t),t&&detach(h),destroy_component(m,t),p=!1,run_all(_)}}}function getDates(t){const e=new Date;let n=e.getFullYear();const r=e.getMonth();e.getDate();let o,i;switch(t){case"currentMonth":o=i=r;break;case"currentYear":o=0,i=o+11;break;case"lastSemiYear":o=r<6?6:0,i=o+5,o>5&&--n;break;case"lastQuarter":o=r<3?9:r<6?0:r<9?3:6,i=o+2,o>8&&--n;break;case"lastMonth":o=i=0===r?11:r-1,11===o&&--n;break;default:o=0,i=o+11,--n}return{first:new Date(n,o,1),last:new Date(n,i+1,0)}}function instance$i(t,e,n){const r=createEventDispatcher(),{DatePicker:o}=getAttractions;let{value:i}=e,{id:a}=e,{item:s}=e,{noForm:c=!1}=e,{classId:l}=e,{required:d}=e,{disabled:u}=e;const{noCalendar:h,preset:m}=s.properties||{};let f="%d.%m.%Y",p="%d.%m.%Y",_=i?.from,g=i?.to;if(m){const{first:t,last:e}=getDates(m);t&&(_=t),e&&(g=e)}"Invalid Date"===_?.toString()&&(_=void 0),"Invalid Date"===g?.toString()&&(g=void 0),u&&(void 0===_&&(f=""),void 0===g&&(p=""));return t.$$set=t=>{"value"in t&&n(13,i=t.value),"id"in t&&n(0,a=t.id),"item"in t&&n(14,s=t.item),"noForm"in t&&n(1,c=t.noForm),"classId"in t&&n(2,l=t.classId),"required"in t&&n(3,d=t.required),"disabled"in t&&n(4,u=t.disabled)},[a,c,l,d,u,f,p,_,g,o,h,({detail:t})=>{n(7,_=applyDate(t.value,_)),g&&_&&g.valueOf()-_.valueOf()<0&&n(7,_=void 0),r("change",{value:_,range:"_from"})},({detail:t})=>{n(8,g=applyDate(t.value,g)),g&&_&&g.valueOf()-_.valueOf()<0&&n(8,g=void 0),r("change",{value:g,range:"_to"})},i,s,function(){_=this.value,n(7,_)},function(){g=this.value,n(8,g)}]}class InputDateRange extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-7itxk4-style")||add_css$g(),init(this,t,instance$i,create_fragment$i,safe_not_equal,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}const xml2json=(t,e)=>{var n={toObj:function(t){var e={};if(1==t.nodeType){if(t.attributes.length)for(var r=0;r<t.attributes.length;r++)e["@"+t.attributes[r].nodeName]=(t.attributes[r].nodeValue||"").toString();if(t.firstChild){for(var o=0,i=0,a=!1,s=t.firstChild;s;s=s.nextSibling)1==s.nodeType?a=!0:3==s.nodeType&&s.nodeValue.match(/[^ \f\n\r\t\v]/)?o++:4==s.nodeType&&i++;if(a)if(o<2&&i<2){n.removeWhite(t);for(s=t.firstChild;s;s=s.nextSibling)3==s.nodeType?e["#text"]=n.escape(s.nodeValue):4==s.nodeType?e["#cdata"]=n.escape(s.nodeValue):e[s.nodeName]?e[s.nodeName]instanceof Array?e[s.nodeName][e[s.nodeName].length]=n.toObj(s):e[s.nodeName]=[e[s.nodeName],n.toObj(s)]:e[s.nodeName]=n.toObj(s)}else t.attributes.length?e["#text"]=n.escape(n.innerXml(t)):e=n.escape(n.innerXml(t));else if(o)t.attributes.length?e["#text"]=n.escape(n.innerXml(t)):e=n.escape(n.innerXml(t));else if(i)if(i>1)e=n.escape(n.innerXml(t));else for(s=t.firstChild;s;s=s.nextSibling)e["#cdata"]=n.escape(s.nodeValue)}t.attributes.length||t.firstChild||(e=null)}else 9==t.nodeType&&(e=n.toObj(t.documentElement));return e},toJson:function(t,e,r){var o=e?'"'+e+'"':"";if(t instanceof Array){for(var i=0,a=t.length;i<a;i++)t[i]=n.toJson(t[i],"",r+"\t");o+=(e?":[":"[")+(t.length>1?"\n"+r+"\t"+t.join(",\n"+r+"\t")+"\n"+r:t.join(""))+"]"}else if(null==t)o+=(e&&":")+"null";else if("object"==typeof t){var s=[];for(var c in t)s[s.length]=n.toJson(t[c],c,r+"\t");o+=(e?":{":"{")+(s.length>1?"\n"+r+"\t"+s.join(",\n"+r+"\t")+"\n"+r:s.join(""))+"}"}else o+="string"==typeof t?(e&&":")+'"'+t.toString()+'"':(e&&":")+t.toString();return o},innerXml:function(t){var e="";if("innerHTML"in t)e=t.innerHTML;else for(var n=function(t){var e="";if(1==t.nodeType){e+="<"+t.nodeName;for(var r=0;r<t.attributes.length;r++)e+=" "+t.attributes[r].nodeName+'="'+(t.attributes[r].nodeValue||"").toString()+'"';if(t.firstChild){e+=">";for(var o=t.firstChild;o;o=o.nextSibling)e+=n(o);e+="</"+t.nodeName+">"}else e+="/>"}else 3==t.nodeType?e+=t.nodeValue:4==t.nodeType&&(e+="<![CDATA["+t.nodeValue+"]]>");return e},r=t.firstChild;r;r=r.nextSibling)e+=n(r);return e},escape:function(t){return t.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(t){t.normalize();for(var e=t.firstChild;e;)if(3==e.nodeType)if(e.nodeValue.match(/[^ \f\n\r\t\v]/))e=e.nextSibling;else{var r=e.nextSibling;t.removeChild(e),e=r}else 1==e.nodeType?(n.removeWhite(e),e=e.nextSibling):e=e.nextSibling;return t}};return t=(new window.DOMParser).parseFromString(t,"text/xml"),n.toObj(n.removeWhite(t))};var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},requirejs,require,define;function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var e={exports:{}};return t(e,e.exports),e.exports
|
|
1
|
+
System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","@enablerr-ui/task"],function(exports){"use strict";var Request,Storage,task_notification,currentRoles,TextArea,toasts,settings,Page,getAttractions,PopOver,user,taskClipboard;return{setters:[function(t){Request=t.Request,Storage=t.Storage,task_notification=t.task_notification,currentRoles=t.currentRoles,TextArea=t.TextArea,toasts=t.toasts,settings=t.settings,Page=t.Page},function(t){getAttractions=t.getAttractions,PopOver=t.PopOver},function(t){user=t.user},function(t){taskClipboard=t.taskClipboard}],execute:function(){function _mergeNamespaces(t,e){return e.forEach(function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach(function(n){if("default"!==n&&!(n in t)){var r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:function(){return e[n]}})}})}),Object.freeze(t)}const version=exports("version","0.3.46"),checkDate=exports("checkDate",(t,e)=>"string"!=typeof t||t.length<20||!(e=t.split(" · "))?t:e.map(t=>2===t.split("T").length&&3===t.split("T")[0].split("-").length?new Date(t).toLocaleDateString():t).filter(t=>!!t).join(" · ")),checkDateTime=t=>{try{return new Date(t).toLocaleString()}catch{return t}},checkDateRange=(t,e)=>{let n,r;try{n=e[t+"_from"],n=new Date(n||"").toLocaleDateString(),"Invalid Date"===n&&(n=" ")}catch{n=" "}try{r=e[t+"_to"],r=new Date(r||"").toLocaleDateString(),"Invalid Date"===r&&(r="")}catch{r=""}return[n,r].filter(t=>""!==t).join(" - ").trim()},checkBoolean=t=>t?"(ja)":"(nein)",getRecordDescription=(t,e)=>{if(!t.display&&!t.items)return"";const n={...e};return(t.display?.reduce((e,r)=>{let[o,i]=r.split(".");if(t.list?.find(({name:t})=>t===o)&&i&&void 0!==n[o]){const t=`${o}_${i}`;n[t]=n[o][i],o=t}return e.find(t=>t===o)||e.push(o),e},[]).map(t=>"boolean"==typeof n[t]?checkBoolean(n[t]):checkDate(n["_"+t]||n[t]))||t.items.map(t=>"object"===t.type?e["_"+t.name]:"list"===t.type?"":("boolean"==typeof e[t.name]&&checkBoolean(e[t.name]),e[t.name]))).map(t=>t?.toString().split(" · ").filter(t=>!!t&&!checkObjectId(t)).join(" · ")).filter(t=>!!t).join(" • ")},checkObjectId=t=>/^[0-9a-f]{24}/.test(t),getData=(t,e)=>{try{return e.split(".").reduce((t,e)=>t[e],t)??""}catch{return""}},addDays=function(t,e){var n=new Date(t);return n.setDate(n.getDate()+Number(e)),n};function noop(){}function is_promise(t){return t&&"object"==typeof t&&"function"==typeof t.then}function run(t){return t()}function blank_object(){return Object.create(null)}function run_all(t){t.forEach(run)}function is_function(t){return"function"==typeof t}function safe_not_equal(t,e){return t!=t?e==e:t!==e||t&&"object"==typeof t||"function"==typeof t}function is_empty(t){return 0===Object.keys(t).length}function subscribe(t,...e){if(null==t)return noop;const n=t.subscribe(...e);return n.unsubscribe?()=>n.unsubscribe():n}function component_subscribe(t,e,n){t.$$.on_destroy.push(subscribe(e,n))}function null_to_empty(t){return null==t?"":t}function set_store_value(t,e,n=e){return t.set(n),e}function append(t,e){t.appendChild(e)}function insert(t,e,n){t.insertBefore(e,n||null)}function detach(t){t.parentNode.removeChild(t)}function destroy_each(t,e){for(let n=0;n<t.length;n+=1)t[n]&&t[n].d(e)}function element(t){return document.createElement(t)}function svg_element(t){return document.createElementNS("http://www.w3.org/2000/svg",t)}function text(t){return document.createTextNode(t)}function space(){return text(" ")}function empty(){return text("")}function listen(t,e,n,r){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}function prevent_default(t){return function(e){return e.preventDefault(),t.call(this,e)}}function stop_propagation(t){return function(e){return e.stopPropagation(),t.call(this,e)}}function attr(t,e,n){null==n?t.removeAttribute(e):t.getAttribute(e)!==n&&t.setAttribute(e,n)}function children(t){return Array.from(t.childNodes)}function set_data(t,e){e=""+e,t.wholeText!==e&&(t.data=e)}function set_input_value(t,e){t.value=null==e?"":e}function set_style(t,e,n,r){t.style.setProperty(e,n,r?"important":"")}function toggle_class(t,e,n){t.classList[n?"add":"remove"](e)}function custom_event(t,e){const n=document.createEvent("CustomEvent");return n.initCustomEvent(t,!1,!1,e),n}let current_component;function set_current_component(t){current_component=t}function get_current_component(){if(!current_component)throw new Error("Function called outside component initialization");return current_component}function onMount(t){get_current_component().$$.on_mount.push(t)}function onDestroy(t){get_current_component().$$.on_destroy.push(t)}function createEventDispatcher(){const t=get_current_component();return(e,n)=>{const r=t.$$.callbacks[e];if(r){const o=custom_event(e,n);r.slice().forEach(e=>{e.call(t,o)})}}}function bubble(t,e){const n=t.$$.callbacks[e.type];n&&n.slice().forEach(t=>t(e))}const dirty_components=[],binding_callbacks=[],render_callbacks=[],flush_callbacks=[],resolved_promise=Promise.resolve();let update_scheduled=!1;function schedule_update(){update_scheduled||(update_scheduled=!0,resolved_promise.then(flush))}function tick(){return schedule_update(),resolved_promise}function add_render_callback(t){render_callbacks.push(t)}function add_flush_callback(t){flush_callbacks.push(t)}let flushing=!1;const seen_callbacks=new Set;function flush(){if(!flushing){flushing=!0;do{for(let t=0;t<dirty_components.length;t+=1){const e=dirty_components[t];set_current_component(e),update(e.$$)}for(set_current_component(null),dirty_components.length=0;binding_callbacks.length;)binding_callbacks.pop()();for(let t=0;t<render_callbacks.length;t+=1){const e=render_callbacks[t];seen_callbacks.has(e)||(seen_callbacks.add(e),e())}render_callbacks.length=0}while(dirty_components.length);for(;flush_callbacks.length;)flush_callbacks.pop()();update_scheduled=!1,flushing=!1,seen_callbacks.clear()}}function update(t){if(null!==t.fragment){t.update(),run_all(t.before_update);const e=t.dirty;t.dirty=[-1],t.fragment&&t.fragment.p(t.ctx,e),t.after_update.forEach(add_render_callback)}}const outroing=new Set;let outros;function group_outros(){outros={r:0,c:[],p:outros}}function check_outros(){outros.r||run_all(outros.c),outros=outros.p}function transition_in(t,e){t&&t.i&&(outroing.delete(t),t.i(e))}function transition_out(t,e,n,r){if(t&&t.o){if(outroing.has(t))return;outroing.add(t),outros&&outros.c.push(()=>{outroing.delete(t),r&&(n&&t.d(1),r())}),t.o(e)}}function handle_promise(t,e){const n=e.token={};function r(t,r,o,i){if(e.token!==n)return;e.resolved=i;let a=e.ctx;void 0!==o&&(a=a.slice(),a[o]=i);const s=t&&(e.current=t)(a);let c=!1;e.block&&(e.blocks?e.blocks.forEach((t,n)=>{n!==r&&t&&(group_outros(),transition_out(t,1,1,()=>{e.blocks[n]===t&&(e.blocks[n]=null)}),check_outros())}):e.block.d(1),s.c(),transition_in(s,1),s.m(e.mount(),e.anchor),c=!0),e.block=s,e.blocks&&(e.blocks[r]=s),c&&flush()}if(is_promise(t)){const n=get_current_component();if(t.then(t=>{set_current_component(n),r(e.then,1,e.value,t),set_current_component(null)},t=>{if(set_current_component(n),r(e.catch,2,e.error,t),set_current_component(null),!e.hasCatch)throw t}),e.current!==e.pending)return r(e.pending,0),!0}else{if(e.current!==e.then)return r(e.then,1,e.value,t),!0;e.resolved=t}}function update_await_block_branch(t,e,n){const r=e.slice(),{resolved:o}=t;t.current===t.then&&(r[t.value]=o),t.current===t.catch&&(r[t.error]=o),t.block.p(r,n)}const globals="undefined"!=typeof window?window:"undefined"!=typeof globalThis?globalThis:global;function outro_and_destroy_block(t,e){transition_out(t,1,1,()=>{e.delete(t.key)})}function update_keyed_each(t,e,n,r,o,i,a,s,c,l,d,u){let h=t.length,m=i.length,f=h;const p={};for(;f--;)p[t[f].key]=f;const _=[],g=new Map,w=new Map;for(f=m;f--;){const t=u(o,i,f),s=n(t);let c=a.get(s);c?r&&c.p(t,e):(c=l(s,t),c.c()),g.set(s,_[f]=c),s in p&&w.set(s,Math.abs(f-p[s]))}const $=new Set,y=new Set;function b(t){transition_in(t,1),t.m(s,d),a.set(t.key,t),d=t.first,m--}for(;h&&m;){const e=_[m-1],n=t[h-1],r=e.key,o=n.key;e===n?(d=e.first,h--,m--):g.has(o)?!a.has(r)||$.has(r)?b(e):y.has(o)?h--:w.get(r)>w.get(o)?(y.add(r),b(e)):($.add(o),h--):(c(n,a),h--)}for(;h--;){const e=t[h];g.has(e.key)||c(e,a)}for(;m;)b(_[m-1]);return _}function bind(t,e,n){const r=t.$$.props[e];void 0!==r&&(t.$$.bound[r]=n,n(t.$$.ctx[r]))}function create_component(t){t&&t.c()}function mount_component(t,e,n,r){const{fragment:o,on_mount:i,on_destroy:a,after_update:s}=t.$$;o&&o.m(e,n),r||add_render_callback(()=>{const e=i.map(run).filter(is_function);a?a.push(...e):run_all(e),t.$$.on_mount=[]}),s.forEach(add_render_callback)}function destroy_component(t,e){const n=t.$$;null!==n.fragment&&(run_all(n.on_destroy),n.fragment&&n.fragment.d(e),n.on_destroy=n.fragment=null,n.ctx=[])}function make_dirty(t,e){-1===t.$$.dirty[0]&&(dirty_components.push(t),schedule_update(),t.$$.dirty.fill(0)),t.$$.dirty[e/31|0]|=1<<e%31}function init(t,e,n,r,o,i,a=[-1]){const s=current_component;set_current_component(t);const c=t.$$={fragment:null,ctx:null,props:i,update:noop,not_equal:o,bound:blank_object(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(s?s.$$.context:e.context||[]),callbacks:blank_object(),dirty:a,skip_bound:!1};let l=!1;if(c.ctx=n?n(t,e.props||{},(e,n,...r)=>{const i=r.length?r[0]:n;return c.ctx&&o(c.ctx[e],c.ctx[e]=i)&&(!c.skip_bound&&c.bound[e]&&c.bound[e](i),l&&make_dirty(t,e)),n}):[],c.update(),l=!0,run_all(c.before_update),c.fragment=!!r&&r(c.ctx),e.target){if(e.hydrate){const t=children(e.target);c.fragment&&c.fragment.l(t),t.forEach(detach)}else c.fragment&&c.fragment.c();e.intro&&transition_in(t.$$.fragment),mount_component(t,e.target,e.anchor,e.customElement),flush()}set_current_component(s)}class SvelteComponent{$destroy(){destroy_component(this,1),this.$destroy=noop}$on(t,e){const n=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return n.push(e),()=>{const t=n.indexOf(e);-1!==t&&n.splice(t,1)}}$set(t){this.$$set&&!is_empty(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}function create_fragment$T(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polygon"),attr(n,"d","M5 17H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-1"),attr(r,"points","12 15 17 21 7 21 12 15"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-airplay "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-airplay "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$T(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class AirplayIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$T,create_fragment$T,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$S(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("line"),o=svg_element("line"),attr(n,"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"),attr(r,"x1","12"),attr(r,"y1","9"),attr(r,"x2","12"),attr(r,"y2","13"),attr(o,"x1","12"),attr(o,"y1","17"),attr(o,"x2","12.01"),attr(o,"y2","17"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-alert-triangle "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-alert-triangle "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$S(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class AlertTriangleIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$S,create_fragment$S,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$R(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("circle"),r=svg_element("polyline"),o=svg_element("line"),attr(n,"cx","12"),attr(n,"cy","12"),attr(n,"r","10"),attr(r,"points","8 12 12 16 16 12"),attr(o,"x1","12"),attr(o,"y1","8"),attr(o,"x2","12"),attr(o,"y2","16"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-arrow-down-circle "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-arrow-down-circle "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$R(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class ArrowDownCircleIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$R,create_fragment$R,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$Q(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("path"),attr(n,"d","M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z"),attr(r,"d","M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-book-open "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-book-open "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$Q(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class BookOpenIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$Q,create_fragment$Q,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$P(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("circle"),attr(n,"d","M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"),attr(r,"cx","12"),attr(r,"cy","13"),attr(r,"r","4"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-camera "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-camera "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$P(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CameraIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$P,create_fragment$P,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$O(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),attr(n,"d","M22 11.08V12a10 10 0 1 1-5.93-9.14"),attr(r,"points","22 4 12 14.01 9 11.01"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-check-circle "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-check-circle "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$O(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CheckCircleIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$O,create_fragment$O,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$N(t){let e,n,r;return{c(){e=svg_element("svg"),n=svg_element("path"),attr(n,"d","M18 3a3 3 0 0 0-3 3v12a3 3 0 0 0 3 3 3 3 0 0 0 3-3 3 3 0 0 0-3-3H6a3 3 0 0 0-3 3 3 3 0 0 0 3 3 3 3 0 0 0 3-3V6a3 3 0 0 0-3-3 3 3 0 0 0-3 3 3 3 0 0 0 3 3h12a3 3 0 0 0 3-3 3 3 0 0 0-3-3z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",r="feather feather-command "+t[2])},m(t,r){insert(t,e,r),append(e,n)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&r!==(r="feather feather-command "+t[2])&&attr(e,"class",r)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$N(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CommandIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$N,create_fragment$N,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$M(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("polyline"),r=svg_element("path"),attr(n,"points","9 10 4 15 9 20"),attr(r,"d","M20 4v7a4 4 0 0 1-4 4H4"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-corner-down-left "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-corner-down-left "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$M(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class CornerDownLeftIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$M,create_fragment$M,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$L(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("line"),o=svg_element("line"),attr(n,"d","M21 4H8l-7 8 7 8h13a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"),attr(r,"x1","18"),attr(r,"y1","9"),attr(r,"x2","12"),attr(r,"y2","15"),attr(o,"x1","12"),attr(o,"y1","9"),attr(o,"x2","18"),attr(o,"y2","15"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-delete "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-delete "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$L(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class DeleteIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$L,create_fragment$L,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$K(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),o=svg_element("line"),attr(n,"d","M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"),attr(r,"points","15 3 21 3 21 9"),attr(o,"x1","10"),attr(o,"y1","14"),attr(o,"x2","21"),attr(o,"y2","3"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-external-link "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-external-link "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$K(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class ExternalLinkIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$K,create_fragment$K,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$J(t){let e,n,r,o,i,a;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),o=svg_element("line"),i=svg_element("line"),attr(n,"d","M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"),attr(r,"points","14 2 14 8 20 8"),attr(o,"x1","12"),attr(o,"y1","18"),attr(o,"x2","12"),attr(o,"y2","12"),attr(i,"x1","9"),attr(i,"y1","15"),attr(i,"x2","15"),attr(i,"y2","15"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",a="feather feather-file-plus "+t[2])},m(t,a){insert(t,e,a),append(e,n),append(e,r),append(e,o),append(e,i)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&a!==(a="feather feather-file-plus "+t[2])&&attr(e,"class",a)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$J(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class FilePlusIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$J,create_fragment$J,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$I(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("circle"),r=svg_element("line"),o=svg_element("path"),attr(n,"cx","12"),attr(n,"cy","12"),attr(n,"r","10"),attr(r,"x1","2"),attr(r,"y1","12"),attr(r,"x2","22"),attr(r,"y2","12"),attr(o,"d","M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-globe "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-globe "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$I(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class GlobeIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$I,create_fragment$I,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$H(t){let e,n,r,o,i,a,s,c;return{c(){e=svg_element("svg"),n=svg_element("line"),r=svg_element("line"),o=svg_element("line"),i=svg_element("line"),a=svg_element("line"),s=svg_element("line"),attr(n,"x1","8"),attr(n,"y1","6"),attr(n,"x2","21"),attr(n,"y2","6"),attr(r,"x1","8"),attr(r,"y1","12"),attr(r,"x2","21"),attr(r,"y2","12"),attr(o,"x1","8"),attr(o,"y1","18"),attr(o,"x2","21"),attr(o,"y2","18"),attr(i,"x1","3"),attr(i,"y1","6"),attr(i,"x2","3.01"),attr(i,"y2","6"),attr(a,"x1","3"),attr(a,"y1","12"),attr(a,"x2","3.01"),attr(a,"y2","12"),attr(s,"x1","3"),attr(s,"y1","18"),attr(s,"x2","3.01"),attr(s,"y2","18"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",c="feather feather-list "+t[2])},m(t,c){insert(t,e,c),append(e,n),append(e,r),append(e,o),append(e,i),append(e,a),append(e,s)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&c!==(c="feather feather-list "+t[2])&&attr(e,"class",c)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$H(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class ListIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$H,create_fragment$H,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$G(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("polyline"),attr(n,"d","M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"),attr(r,"points","22,6 12,13 2,6"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-mail "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-mail "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$G(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class MailIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$G,create_fragment$G,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$F(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("path"),r=svg_element("circle"),attr(n,"d","M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"),attr(r,"cx","12"),attr(r,"cy","10"),attr(r,"r","3"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-map-pin "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-map-pin "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$F(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class MapPinIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$F,create_fragment$F,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$E(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("polyline"),r=svg_element("line"),o=svg_element("path"),attr(n,"points","23 7 23 1 17 1"),attr(r,"x1","16"),attr(r,"y1","8"),attr(r,"x2","23"),attr(r,"y2","1"),attr(o,"d","M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-phone-outgoing "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-phone-outgoing "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$E(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class PhoneOutgoingIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$E,create_fragment$E,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$D(t){let e,n,r,o,i;return{c(){e=svg_element("svg"),n=svg_element("polyline"),r=svg_element("path"),o=svg_element("rect"),attr(n,"points","6 9 6 2 18 2 18 9"),attr(r,"d","M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2"),attr(o,"x","6"),attr(o,"y","14"),attr(o,"width","12"),attr(o,"height","8"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",i="feather feather-printer "+t[2])},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&i!==(i="feather feather-printer "+t[2])&&attr(e,"class",i)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$D(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class PrinterIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$D,create_fragment$D,safe_not_equal,{size:0,strokeWidth:1,class:2})}}function create_fragment$C(t){let e,n,r,o;return{c(){e=svg_element("svg"),n=svg_element("circle"),r=svg_element("line"),attr(n,"cx","11"),attr(n,"cy","11"),attr(n,"r","8"),attr(r,"x1","21"),attr(r,"y1","21"),attr(r,"x2","16.65"),attr(r,"y2","16.65"),attr(e,"xmlns","http://www.w3.org/2000/svg"),attr(e,"width",t[0]),attr(e,"height",t[0]),attr(e,"fill","none"),attr(e,"viewBox","0 0 24 24"),attr(e,"stroke","currentColor"),attr(e,"stroke-width",t[1]),attr(e,"stroke-linecap","round"),attr(e,"stroke-linejoin","round"),attr(e,"class",o="feather feather-search "+t[2])},m(t,o){insert(t,e,o),append(e,n),append(e,r)},p(t,[n]){1&n&&attr(e,"width",t[0]),1&n&&attr(e,"height",t[0]),2&n&&attr(e,"stroke-width",t[1]),4&n&&o!==(o="feather feather-search "+t[2])&&attr(e,"class",o)},i:noop,o:noop,d(t){t&&detach(e)}}}function instance$C(t,e,n){let{size:r="100%"}=e,{strokeWidth:o=2}=e,{class:i=""}=e;return"100%"!==r&&(r="x"===r.slice(-1)?r.slice(0,r.length-1)+"em":parseInt(r)+"px"),t.$$set=t=>{"size"in t&&n(0,r=t.size),"strokeWidth"in t&&n(1,o=t.strokeWidth),"class"in t&&n(2,i=t.class)},[r,o,i]}class SearchIcon extends SvelteComponent{constructor(t){super(),init(this,t,instance$C,create_fragment$C,safe_not_equal,{size:0,strokeWidth:1,class:2})}}const{document:document_1$g}=globals;function add_css$x(){var t=element("style");t.id="svelte-47aais-style",t.textContent=".feather.svelte-47aais.svelte-47aais{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-47aais.svelte-47aais{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-47aais .editRow.svelte-47aais{width:1em}.eList.svelte-47aais table.svelte-47aais{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-47aais table thead.svelte-47aais{position:sticky;top:0;background:#326173;color:white}.eList.svelte-47aais table thead tr.svelte-47aais{height:2.3em}.eList.svelte-47aais table tbody tr.svelte-47aais{height:2.75em !important}th.svelte-47aais.svelte-47aais,td.svelte-47aais.svelte-47aais{padding-left:0.4em;padding-right:0.4em}td.number.svelte-47aais.svelte-47aais{text-align:end}tr.pointer.svelte-47aais.svelte-47aais:hover{background-color:#DAE1E5}tr.active.svelte-47aais.svelte-47aais{color:#326173;background-color:#fcebd5}tr.blocked.svelte-47aais.svelte-47aais{color:red !important}tr.undeliverable.svelte-47aais.svelte-47aais{color:orange}",append(document_1$g.head,t)}function get_then_context$4(t){t[49]=t[50].items}function get_each_context$e(t,e,n){const r=t.slice();return r[51]=e[n],r[53]=n,r}function get_each_context_1$9(t,e,n){const r=t.slice();return r[54]=e[n],r}function get_each_context_2$6(t,e,n){const r=t.slice();return r[54]=e[n],r}function create_catch_block$d(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$d(t){let e,n,r,o,i,a;get_then_context$4(t);let s=t[5]?.length&&create_if_block_5$7(t),c=t[49]?.length&&create_if_block_3$8(t),l=t[5]?.length&&create_if_block$x(t);return{c(){s&&s.c(),e=space(),n=element("div"),r=element("table"),c&&c.c(),o=space(),i=element("tbody"),l&&l.c(),attr(r,"striped",""),attr(r,"class","svelte-47aais"),attr(n,"class","eList svelte-47aais")},m(t,d){s&&s.m(t,d),insert(t,e,d),insert(t,n,d),append(n,r),c&&c.m(r,null),append(r,o),append(r,i),l&&l.m(i,null),a=!0},p(t,n){get_then_context$4(t),t[5]?.length?s?(s.p(t,n),32&n[0]&&transition_in(s,1)):(s=create_if_block_5$7(t),s.c(),transition_in(s,1),s.m(e.parentNode,e)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),t[49]?.length?c?c.p(t,n):(c=create_if_block_3$8(t),c.c(),c.m(r,o)):c&&(c.d(1),c=null),t[5]?.length?l?(l.p(t,n),32&n[0]&&transition_in(l,1)):(l=create_if_block$x(t),l.c(),transition_in(l,1),l.m(i,null)):l&&(group_outros(),transition_out(l,1,1,()=>{l=null}),check_outros())},i(t){a||(transition_in(s),transition_in(l),a=!0)},o(t){transition_out(s),transition_out(l),a=!1},d(t){s&&s.d(t),t&&detach(e),t&&detach(n),c&&c.d(),l&&l.d()}}}function create_if_block_5$7(t){let e,n,r,o,i,a,s,c,l,d,u,h=t[6]&&create_if_block_6$5(t);function m(e){t[33](e)}let f={id:t[10]};return void 0!==t[3]&&(f.value=t[3]),o=new t[8]({props:f}),binding_callbacks.push(()=>bind(o,"value",m)),o.$on("input",t[14]),c=new DeleteIcon({props:{size:"18"}}),{c(){h&&h.c(),e=space(),n=element("div"),r=text("Suchen: "),create_component(o.$$.fragment),a=space(),s=element("span"),create_component(c.$$.fragment),attr(s,"class","feather pointer svelte-47aais"),set_style(n,"margin-bottom","1em"),set_style(n,"position","relative")},m(i,m){h&&h.m(i,m),insert(i,e,m),insert(i,n,m),append(n,r),mount_component(o,n,null),append(n,a),append(n,s),mount_component(c,s,null),l=!0,d||(u=listen(s,"click",t[16]),d=!0)},p(t,n){t[6]?h?64&n[0]&&transition_in(h,1):(h=create_if_block_6$5(t),h.c(),transition_in(h,1),h.m(e.parentNode,e)):h&&(group_outros(),transition_out(h,1,1,()=>{h=null}),check_outros());const r={};!i&&8&n[0]&&(i=!0,r.value=t[3],add_flush_callback(()=>i=!1)),o.$set(r)},i(t){l||(transition_in(h),transition_in(o.$$.fragment,t),transition_in(c.$$.fragment,t),l=!0)},o(t){transition_out(h),transition_out(o.$$.fragment,t),transition_out(c.$$.fragment,t),l=!1},d(t){h&&h.d(t),t&&detach(e),t&&detach(n),destroy_component(o),destroy_component(c),d=!1,u()}}}function create_if_block_6$5(t){let e,n;return e=new t[7]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_3$8(t){let e,n,r,o=t[4]&&t[0]&&create_if_block_4$8(),i=t[49],a=[];for(let e=0;e<i.length;e+=1)a[e]=create_each_block_2$6(get_each_context_2$6(t,i,e));return{c(){e=element("thead"),n=element("tr"),o&&o.c(),r=space();for(let t=0;t<a.length;t+=1)a[t].c();attr(n,"class","svelte-47aais"),attr(e,"class","svelte-47aais")},m(t,i){insert(t,e,i),append(e,n),o&&o.m(n,null),append(n,r);for(let t=0;t<a.length;t+=1)a[t].m(n,null)},p(t,e){if(t[4]&&t[0]?o||(o=create_if_block_4$8(),o.c(),o.m(n,r)):o&&(o.d(1),o=null),8196&e[0]){let r;for(i=t[49],r=0;r<i.length;r+=1){const o=get_each_context_2$6(t,i,r);a[r]?a[r].p(o,e):(a[r]=create_each_block_2$6(o),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=i.length}},d(t){t&&detach(e),o&&o.d(),destroy_each(a,t)}}}function create_if_block_4$8(t){let e;return{c(){e=element("th"),attr(e,"class","svelte-47aais")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_each_block_2$6(t){let e,n,r=t[54]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-47aais")},m(t,r){insert(t,e,r),append(e,n)},p(t,e){4&e[0]&&r!==(r=t[54]?.designation+"")&&set_data(n,r)},d(t){t&&detach(e)}}}function create_if_block$x(t){let e,n,r=[],o=new Map,i=t[5];const a=t=>t[51]?._id;for(let e=0;e<i.length;e+=1){let n=get_each_context$e(t,i,e),s=a(n);o.set(s,r[e]=create_each_block$e(s,n))}return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,o){for(let e=0;e<r.length;e+=1)r[e].m(t,o);insert(t,e,o),n=!0},p(t,n){178239&n[0]&&(i=t[5],group_outros(),r=update_keyed_each(r,n,a,1,t,i,o,e.parentNode,outro_and_destroy_block,create_each_block$e,e,get_each_context$e),check_outros())},i(t){if(!n){for(let t=0;t<i.length;t+=1)transition_in(r[t]);n=!0}},o(t){for(let t=0;t<r.length;t+=1)transition_out(r[t]);n=!1},d(t){for(let e=0;e<r.length;e+=1)r[e].d(t);t&&detach(e)}}}function create_if_block_1$l(t){let e,n,r,o,i,a,s=t[4]&&t[0]&&create_if_block_2$d(t),c=t[49],l=[];for(let e=0;e<c.length;e+=1)l[e]=create_each_block_1$9(get_each_context_1$9(t,c,e));return{c(){e=element("tr"),s&&s.c(),n=space();for(let t=0;t<l.length;t+=1)l[t].c();r=space(),attr(e,"class","pointer svelte-47aais"),toggle_class(e,"active",t[51]._id===t[1]),toggle_class(e,"blocked",!!t[51].blocked),toggle_class(e,"undeliverable",!!t[51].undeliverable)},m(c,d){insert(c,e,d),s&&s.m(e,null),append(e,n);for(let t=0;t<l.length;t+=1)l[t].m(e,null);append(e,r),o=!0,i||(a=listen(e,"click",stop_propagation(function(){is_function(t[12](t[51],t[53]))&&t[12](t[51],t[53]).apply(this,arguments)})),i=!0)},p(o,i){if((t=o)[4]&&t[0]?s?(s.p(t,i),17&i[0]&&transition_in(s,1)):(s=create_if_block_2$d(t),s.c(),transition_in(s,1),s.m(e,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),10276&i[0]){let n;for(c=t[49],n=0;n<c.length;n+=1){const o=get_each_context_1$9(t,c,n);l[n]?l[n].p(o,i):(l[n]=create_each_block_1$9(o),l[n].c(),l[n].m(e,r))}for(;n<l.length;n+=1)l[n].d(1);l.length=c.length}34&i[0]&&toggle_class(e,"active",t[51]._id===t[1]),32&i[0]&&toggle_class(e,"blocked",!!t[51].blocked),32&i[0]&&toggle_class(e,"undeliverable",!!t[51].undeliverable)},i(t){o||(transition_in(s),o=!0)},o(t){transition_out(s),o=!1},d(t){t&&detach(e),s&&s.d(),destroy_each(l,t),i=!1,a()}}}function create_if_block_2$d(t){let e,n,r,o,i;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("td"),create_component(n.$$.fragment),attr(e,"class","editRow svelte-47aais"),set_style(e,"color","#326173")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",stop_propagation(function(){is_function(t[17](t[51]))&&t[17](t[51]).apply(this,arguments)})),o=!0)},p(e,n){t=e},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block_1$9(t){let e,n,r,o=t[11](t[51],t[54])+"";return{c(){e=element("td"),n=text(o),attr(e,"class",r=null_to_empty(t[54].type)+" svelte-47aais")},m(t,r){insert(t,e,r),append(e,n)},p(t,i){36&i[0]&&o!==(o=t[11](t[51],t[54])+"")&&set_data(n,o),4&i[0]&&r!==(r=null_to_empty(t[54].type)+" svelte-47aais")&&attr(e,"class",r)},d(t){t&&detach(e)}}}function create_each_block$e(t,e){let n,r,o,i=e[15](e[51],e[49],e[3]),a=i&&create_if_block_1$l(e);return{key:t,first:null,c(){n=empty(),a&&a.c(),r=empty(),this.first=n},m(t,e){insert(t,n,e),a&&a.m(t,e),insert(t,r,e),o=!0},p(t,n){e=t,44&n[0]&&(i=e[15](e[51],e[49],e[3])),i?a?(a.p(e,n),44&n[0]&&transition_in(a,1)):(a=create_if_block_1$l(e),a.c(),transition_in(a,1),a.m(r.parentNode,r)):a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros())},i(t){o||(transition_in(a),o=!0)},o(t){transition_out(a),o=!1},d(t){t&&detach(n),a&&a.d(t),t&&detach(r)}}}function create_pending_block$d(t){let e,n;return e=new t[7]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$B(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$d,then:create_then_block$d,catch:create_catch_block$d,value:50,blocks:[,,,]};return handle_promise(n=t[2]&&t[13](),o),{c(){e=empty(),o.block.c()},m(t,n){insert(t,e,n),o.block.m(t,o.anchor=n),o.mount=()=>e.parentNode,o.anchor=e,r=!0},p(e,r){t=e,o.ctx=t,4&r[0]&&n!==(n=t[2]&&t[13]())&&handle_promise(n,o)||update_await_block_branch(o,t,r)},i(t){r||(transition_in(o.block),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}r=!1},d(t){t&&detach(e),o.block.d(t),o.token=null,o=null}}}const getDisplayItems=exports("getDisplayItems",async(t,e,n)=>{if(!t)return;let r=[];for(const o of t){if("_total"===o){r.push({name:"_total",designation:"Betrag",type:"number"});continue}if("__total"===o){r.push({name:"__total",designation:"Total CHF",type:"number",decimals:2});continue}const[t,i]=o.split(".");let a=e.list?.find(e=>e.name===t)?.item?.find(t=>t.name===i);if(a&&(a={...a},a.name=`${t}_${i}`,n=n.map(e=>(e[t]&&(e[a.name]=e["_"+t]?e["_"+t][i]:e[t][i]),e))),a||(a=e.items.find(e=>e.name===t)),!a){const e=(await Request.getSchemaByClass(t)).items.find(t=>t.name===i);e&&(a={name:t,designation:e.designation,type:e.type,decimals:e.properties?.decimals||0})}r.find(e=>e?.name===t)||r.push(a)}return r.length?r:e.items});function instance$B(t,e,n){let r;let o=JSON.parse(Storage.getItem("Locale")).id;const i=createEventDispatcher(),{Loading:a,TextField:s}=getAttractions,{currentTasks:c}=user;component_subscribe(t,c,t=>n(37,r=t));let l,d,u,h,{inputList:m}=e,{eventId:f}=e,{prevEventId:p}=e,{record:_}=e,{className:g}=e,{rowId:w}=e,{filterForReady:$=!1}=e,{filter:y}=e,{query:b}=e,{refStatus:v}=e,{showEdit:I=!1}=e,{praefix:C=""}=e,{selectionFields:E=!1}=e,{deList:A}=e,{stopAggregation:S=!1}=e,{shouldBlock:k}=e,{inputSearch:T=""}=e,R=!0,N=T,D=g+Math.floor(9e3*Math.random()+1e3).toString()+"search",x=!1,O=!0;const M=(t,e)=>{if(!e)return;let n=t[e.name];if("__total"===e.name&&void 0===n&&(n=1.081*t._total),!n&&e.name.includes("_")&&!e.name.startsWith("_")){const[r,o]=e.name.split("_");try{n=t[r][o]}catch{}}if(Array.isArray(n)){const t=t=>t.replaceAll(" ",String.fromCharCode(160));if(n.length&&Array.isArray(n[0].serialno)){let e=[];for(const r of n)e=e.concat(r.serialno.map(t));n=e.join(", ")}else n=n.map(t),n.length>3&&(n=n.slice(0,3),n=n.concat("...")),n=n.join(", ")}if(!n&&e.name.split("_").length>1){const[r,o]=e.name.split("_");try{n=t[r][0][o],Array.isArray(n)&&(n=n.join(", "))}catch{}}return"number"===e.type&&(n||(n=t[`_${e.name}`]),n=Number(n)?Number(n).toLocaleString(o,{minimumFractionDigits:e.properties?.decimals||e.decimals||0,maximumFractionDigits:e.properties?.decimals||e.decimals||0}):""),"boolean"===e.type&&"Aktiv"===n&&(n=!1),"number"===e.type?n:"boolean"==typeof n||"boolean"===e.type?checkBoolean(n):checkDate(t[`_${e.name}`]||n||"")},P=Request.getSchemaByClass(g),B=async(t,e)=>{if(!t)return[];if(y){let e;const n=y.startsWith("!");n&&(e=y.replace("!",""));const r=y.startsWith("$");if(e&&!r&&(t=t.filter(t=>r?t[e]===w:n?!t[e]:!!t[e])),r){e=y.replace("$","");const[n,r]=e.split(".");if(_[r]){const e=await Request.getSectionView(n,{[r]:_[r]});t=t.filter(t=>e.find(e=>e._id==t[n]))}else t=[]}}if(v&&!b)return n(18,v=[].concat(v)),t.filter(t=>!!v.find(e=>t._task.status===e));if("Information"===e.state.task)return t;if(p){const e=await Request.getEvent(p);if("report"===e?.output?.type)return t;if(e?.input?.class?.length&&e.input.class[0].name===g)return"Information"===e.state.task?t.filter(t=>"Closed"!==t._task.status):t.filter(t=>"Ready"===t._task.status)}return t.filter(t=>"WaitingForApproval"===t._task.status||"Ready"===t._task.status||"Closing"===t._task.status)},F=(t,e)=>{if(t){let n,r="1";if("string"==typeof t)n=t;else{const e=Object.keys(t);n=e[0],r=e[1]}"date"===n&&(r="-1");const i=new Intl.Collator(o,{numeric:!0});return 1==r?e.sort((t,e)=>i.compare(t[n],e[n])):e.sort((t,e)=>i.compare(e[n],t[n]))}return e},L=async t=>{let e,r=0;O=!1;const o=t=>new Promise(e=>setTimeout(e,t)),i=await P;for(;r++<200&&!S&&!(e=await q(t,i.id));)await o(500);n(6,x=!1),S&&Request.readTasksByAggregationId(t,!0),e&&(n(5,u=F(d.displaySort,e.data)),window.setTimeout(()=>{const t=document.querySelector("tr.active");t&&t.scrollIntoView({block:"end",behavior:"smooth"}),O=!0},100))},q=async(t,e)=>await Request.readTasksByAggregationId(t,!1,e),V=async(t,e,n,r)=>{const{value:o,refClass:i}=r,[a,s]=n.split("."),c=o?.get(C),l=c&&await getTaskFull(a,c);if(!l)return t;const d=l[s];return d?.length?d.map(n=>{let r=t?.find(t=>t._id===n[e])||{};r={...r};for(const t in r)n[t]&&(r[t]=n[t]);for(const t in n)n[t]&&(r[t]=n[t]);return setTaskSelection(i+r._id.toString(),r),r}):t};onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(D)?.focus()},200)}),task_notification.subscribe(async t=>{if(!t)return;const e=await P;t.eventId===e.id&&(refreshList(e.class,t.eventId),n(2,R=!n(2,R=!1)))});return t.$$set=t=>{"inputList"in t&&n(20,m=t.inputList),"eventId"in t&&n(21,f=t.eventId),"prevEventId"in t&&n(22,p=t.prevEventId),"record"in t&&n(23,_=t.record),"className"in t&&n(24,g=t.className),"rowId"in t&&n(1,w=t.rowId),"filterForReady"in t&&n(25,$=t.filterForReady),"filter"in t&&n(26,y=t.filter),"query"in t&&n(27,b=t.query),"refStatus"in t&&n(18,v=t.refStatus),"showEdit"in t&&n(0,I=t.showEdit),"praefix"in t&&n(28,C=t.praefix),"selectionFields"in t&&n(29,E=t.selectionFields),"deList"in t&&n(30,A=t.deList),"stopAggregation"in t&&n(19,S=t.stopAggregation),"shouldBlock"in t&&n(31,k=t.shouldBlock),"inputSearch"in t&&n(32,T=t.inputSearch)},[I,w,R,N,l,u,x,a,s,c,D,M,(t,e)=>r=>{n(19,S=!0);const o=O?t:h[e];i("choose",{row:o})},async()=>{d=await P,n(4,l=(t=>!r?.length||!!r.find(e=>e===t))(d.id)),b&&n(5,u=h=await Request.getTasksFiltered(d.class,b)),u||n(5,u=h=F(d.displaySort,await m||await getList(d.class,d.id))),500!==u?.length||b||(n(6,x=!0),Request.getTasksList(d.id,!1,!0).then(({aggregationId:t})=>L(t)));let t,e=!1,o="";const a=E&&E?.find(t=>d.class===t.refClass.split(":")[0]),s=a?.value?.get&&a.value.get(C);if(s){const[r,i]=a.refClass.split(":");d.class===r&&n(5,u=await V(u,r,i,a)),e=a.parentClass?.find(t=>"quantity"===t.name),o=a.className,t=await Request.getCountedSection(o,i.split(".")[0],s,r,"quantity")}n(0,I&&=!a),!a&&(y||$||v)&&n(5,u=await B(u,d));const{display:c}=d;let f=await getDisplayItems(c,d,u);return!I&&e?(f=f.concat([{name:"quantity",designation:"h-Soll",type:"number",decimals:2},{name:"ist",designation:"h-Ist",type:"number",decimals:2}]),n(5,u=u.map(e=>{const n=t.find(t=>t._id===e._id);return n&&(e.ist=n.quantity.$numberDecimal),e})),t.map(t=>{if(!u.find(e=>e._id===t._id)){const e=h.find(e=>e._id===t._id);e&&(e.ist=t.quantity.$numberDecimal),u.push(e)}}),i("init",u)):A&&n(5,u=u.filter(t=>!A.find(e=>e?._id===t._id))),k&&n(5,u=u.filter(t=>!t[k])),{items:f}},({detail:{value:t}})=>{n(3,N=t)},(t,e,n)=>{if(!t)return!1;if(!n)return!0;"string"!=typeof n&&(n=n.toString()),n=n.toLowerCase();let r=!1;for(const o of e){const e=M(t,o).toLowerCase();!r&&e.includes(n)&&(r=!0)}return r},()=>{n(3,N="")},async t=>{let e=t._task;e||(e=await getTask(g,"",t._id,!0),e=e._task),window.open(`/task/${e.event}/${e.task_id||e._id}/task?view=standalone`,"_blank")},v,S,m,f,p,_,g,$,y,b,C,E,A,k,T,function(t){N=t,n(3,N)}]}class List$1 extends SvelteComponent{constructor(t){super(),document_1$g.getElementById("svelte-47aais-style")||add_css$x(),init(this,t,instance$B,create_fragment$B,safe_not_equal,{inputList:20,eventId:21,prevEventId:22,record:23,className:24,rowId:1,filterForReady:25,filter:26,query:27,refStatus:18,showEdit:0,praefix:28,selectionFields:29,deList:30,stopAggregation:19,shouldBlock:31,inputSearch:32},[-1,-1])}}function add_css$w(){var t=element("style");t.id="svelte-jb5mrh-style",t.textContent=".eList .flex button.btn{width:max-content !important}.dialog.eList{max-height:90vh}.form--buttons.svelte-jb5mrh{display:flex;gap:1em;padding:0.5em 0}",append(document.head,t)}function create_catch_block$c(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$c(t){let e,n,r=t[45]&&create_if_block$w(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[45]?r?(r.p(t,n),16&n[0]&&transition_in(r,1)):(r=create_if_block$w(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block$w(t){let e,n;return e=new t[25]({props:{title:t[20]?"Auswahl":t[0],class:"eList "+(t[18]?"form":""),$$slots:{default:[create_default_slot$i]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1048577&n[0]&&(r.title=t[20]?"Auswahl":t[0]),262144&n[0]&&(r.class="eList "+(t[18]?"form":"")),33554430&n[0]|32768&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_else_block_1$5(t){let e,n;return e=new Index({props:{schema:t[2],recID:t[1],readonly:t[19]}}),e.$on("choose",function(){is_function(t[34](t[45]))&&t[34](t[45]).apply(this,arguments)}),e.$on("back",t[31]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};4&r[0]&&(o.schema=t[2]),2&r[0]&&(o.recID=t[1]),524288&r[0]&&(o.readonly=t[19]),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_1$k(t){let e,n,r,o,i,a,s;e=new t[26]({props:{text:t[20]?"Zusätzliche Auswahl":""}});const c=[create_if_block_2$c,create_else_block$g],l=[];function d(t,e){return t[20]?0:1}return r=d(t),o=l[r]=c[r](t),a=new List$1({props:{inputSearch:t[15],record:t[3],eventId:t[2].id,className:t[2].class,prevEventId:t[14],filterForReady:t[5],filter:t[6],query:t[7],refStatus:t[8],praefix:t[9],selectionFields:t[10],rowId:t[1],shouldBlock:t[16],deList:t[12],stopAggregation:t[24],showEdit:t[11]}}),a.$on("edit",t[35]),a.$on("choose",t[38]),a.$on("init",t[36]),{c(){create_component(e.$$.fragment),n=space(),o.c(),i=space(),create_component(a.$$.fragment)},m(t,o){mount_component(e,t,o),insert(t,n,o),l[r].m(t,o),insert(t,i,o),mount_component(a,t,o),s=!0},p(t,n){const s={};1048576&n[0]&&(s.text=t[20]?"Zusätzliche Auswahl":""),e.$set(s);let u=r;r=d(t),r===u?l[r].p(t,n):(group_outros(),transition_out(l[u],1,1,()=>{l[u]=null}),check_outros(),o=l[r],o?o.p(t,n):(o=l[r]=c[r](t),o.c()),transition_in(o,1),o.m(i.parentNode,i));const h={};32768&n[0]&&(h.inputSearch=t[15]),8&n[0]&&(h.record=t[3]),4&n[0]&&(h.eventId=t[2].id),4&n[0]&&(h.className=t[2].class),16384&n[0]&&(h.prevEventId=t[14]),32&n[0]&&(h.filterForReady=t[5]),64&n[0]&&(h.filter=t[6]),128&n[0]&&(h.query=t[7]),256&n[0]&&(h.refStatus=t[8]),512&n[0]&&(h.praefix=t[9]),1024&n[0]&&(h.selectionFields=t[10]),2&n[0]&&(h.rowId=t[1]),65536&n[0]&&(h.shouldBlock=t[16]),4096&n[0]&&(h.deList=t[12]),16777216&n[0]&&(h.stopAggregation=t[24]),2048&n[0]&&(h.showEdit=t[11]),a.$set(h)},i(t){s||(transition_in(e.$$.fragment,t),transition_in(o),transition_in(a.$$.fragment,t),s=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(o),transition_out(a.$$.fragment,t),s=!1},d(t){destroy_component(e,t),t&&detach(n),l[r].d(t),t&&detach(i),destroy_component(a,t)}}}function create_else_block$g(t){let e,n,r,o;n=new t[27]({props:{outline:!0,$$slots:{default:[create_default_slot_3$3]},$$scope:{ctx:t}}}),n.$on("click",t[32]);let i=t[29]&&t[13]&&create_if_block_4$7(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i&&i.c(),attr(e,"class","form--buttons svelte-jb5mrh")},m(t,a){insert(t,e,a),mount_component(n,e,null),append(e,r),i&&i.m(e,null),o=!0},p(t,r){const o={};32768&r[1]&&(o.$$scope={dirty:r,ctx:t}),n.$set(o),t[29]&&t[13]?i?(i.p(t,r),8192&r[0]&&transition_in(i,1)):(i=create_if_block_4$7(t),i.c(),transition_in(i,1),i.m(e,null)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){o||(transition_in(n.$$.fragment,t),transition_in(i),o=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),o=!1},d(t){t&&detach(e),destroy_component(n),i&&i.d()}}}function create_if_block_2$c(t){let e,n,r,o,i,a,s=t[23]&&create_if_block_3$7(t);return r=new t[27]({props:{outline:!0,$$slots:{default:[create_default_slot_1$d]},$$scope:{ctx:t}}}),r.$on("click",t[32]),i=new t[26]({props:{text:"Liste aus "+t[17]}}),{c(){s&&s.c(),e=space(),n=element("div"),create_component(r.$$.fragment),o=space(),create_component(i.$$.fragment),attr(n,"class","form--buttons svelte-jb5mrh")},m(t,c){s&&s.m(t,c),insert(t,e,c),insert(t,n,c),mount_component(r,n,null),insert(t,o,c),mount_component(i,t,c),a=!0},p(t,n){t[23]?s?(s.p(t,n),8388608&n[0]&&transition_in(s,1)):(s=create_if_block_3$7(t),s.c(),transition_in(s,1),s.m(e.parentNode,e)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros());const o={};32768&n[1]&&(o.$$scope={dirty:n,ctx:t}),r.$set(o);const a={};131072&n[0]&&(a.text="Liste aus "+t[17]),i.$set(a)},i(t){a||(transition_in(s),transition_in(r.$$.fragment,t),transition_in(i.$$.fragment,t),a=!0)},o(t){transition_out(s),transition_out(r.$$.fragment,t),transition_out(i.$$.fragment,t),a=!1},d(t){s&&s.d(t),t&&detach(e),t&&detach(n),destroy_component(r),t&&detach(o),destroy_component(i,t)}}}function create_default_slot_3$3(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_4$7(t){let e,n;return e=new t[27]({props:{filled:!0,$$slots:{default:[create_default_slot_2$8]},$$scope:{ctx:t}}}),e.$on("click",t[33]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};32768&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$8(t){let e;return{c(){e=text("Neu")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_3$7(t){let e,n;return e=new InputFormField({props:{item:t[21],record:{_id:"",[t[21].name]:""},noForm:"true",classId:"sel_"+t[21].name,eventId:t[22],required:!1,hidden:!1,readonly:!1,deList:t[23]}}),e.$on("notify",t[37]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2097152&n[0]&&(r.item=t[21]),2097152&n[0]&&(r.record={_id:"",[t[21].name]:""}),2097152&n[0]&&(r.classId="sel_"+t[21].name),4194304&n[0]&&(r.eventId=t[22]),8388608&n[0]&&(r.deList=t[23]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$d(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot$i(t){let e,n,r,o;const i=[create_if_block_1$k,create_else_block_1$5],a=[];function s(t,e){return t[45].length&&!t[18]?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_pending_block$c(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$A(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$c,then:create_then_block$c,catch:create_catch_block$c,value:45,blocks:[,,,]};return handle_promise(n=t[30](t[4]),o),{c(){e=empty(),o.block.c()},m(t,n){insert(t,e,n),o.block.m(t,o.anchor=n),o.mount=()=>e.parentNode,o.anchor=e,r=!0},p(e,r){t=e,o.ctx=t,16&r[0]&&n!==(n=t[30](t[4]))&&handle_promise(n,o)||update_await_block_branch(o,t,r)},i(t){r||(transition_in(o.block),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}r=!1},d(t){t&&detach(e),o.block.d(t),o.token=null,o=null}}}function instance$A(t,e,n){let r;const{Dialog:o,Divider:i,Button:a}=getAttractions,s=createEventDispatcher(),{currentTasks:c}=user;component_subscribe(t,c,t=>n(41,r=t));let{title:l}=e,{schema:d}=e,{record:u}=e,{recID:h}=e,{isOpening:m=!0}=e,{filterForReady:f=!1}=e,{filter:p}=e,{query:_}=e,{refStatus:g}=e,{praefix:w=""}=e,{selectionFields:$=!1}=e,{showEdit:y=!0}=e,{deList:b}=e,{newAllowed:v=!0}=e,{prevEventId:I}=e,{inputSearch:C}=e,{shouldBlock:E}=e,A=d.id;d.class;let S,k,T,R,N,D,x,O="",M=!1,P=!1;l??=d.identity.designation;const B=!r?.length||r.find(t=>t===A);return t.$$set=t=>{"title"in t&&n(0,l=t.title),"schema"in t&&n(2,d=t.schema),"record"in t&&n(3,u=t.record),"recID"in t&&n(1,h=t.recID),"isOpening"in t&&n(4,m=t.isOpening),"filterForReady"in t&&n(5,f=t.filterForReady),"filter"in t&&n(6,p=t.filter),"query"in t&&n(7,_=t.query),"refStatus"in t&&n(8,g=t.refStatus),"praefix"in t&&n(9,w=t.praefix),"selectionFields"in t&&n(10,$=t.selectionFields),"showEdit"in t&&n(11,y=t.showEdit),"deList"in t&&n(12,b=t.deList),"newAllowed"in t&&n(13,v=t.newAllowed),"prevEventId"in t&&n(14,I=t.prevEventId),"inputSearch"in t&&n(15,C=t.inputSearch),"shouldBlock"in t&&n(16,E=t.shouldBlock)},[l,h,d,u,m,f,p,_,g,w,$,y,b,v,I,C,E,O,M,S,T,N,D,x,P,o,i,a,c,B,async t=>{if(!t)return!1;const e=await getList(d.class,d.id);if(k=$&&$?.find(t=>d.class===t.refClass.split(":")[0]),n(20,T=k?.value?.get&&k.value.get(w)),T){R=k.refClass;const[t,e]=R.split(":"),[r]=e.split(".");n(21,N=k.parentClass.find(e=>e.name===t));const o=await Request.getSchemaByClass(N.refClass);n(22,D=o.id),n(17,O=k.parentClass.find(t=>t.name===r).designation)}return e},()=>{n(18,M=!1),h||s("back"),y||s("back")},()=>{n(24,P=!0),n(18,M=!1),s("back")},()=>{n(24,P=!0),n(1,h=!1),n(19,S=!1),n(18,M=!0)},t=>({detail:{row:t}})=>{let e=d.display;e&&e.length&&e.map(e=>{const[n,r]=e.split(".");let o=d.list?.find(t=>t.name===n)?.item.find(t=>t.name===r);if(o){t[`${n}_${r}`]=t[n][r]}}),s("choose",{row:t})},({detail:t})=>{n(19,S=!!t._task.visum||"Closed"===t._task.status),n(1,h=t._docId),n(18,M=!0)},({detail:t})=>{T&&n(23,x=t)},({detail:t})=>{if(!t.value)return;const e={_id:t.value};s("choose",{row:e})},function(e){bubble(t,e)}]}class FormList extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-jb5mrh-style")||add_css$w(),init(this,t,instance$A,create_fragment$A,safe_not_equal,{title:0,schema:2,record:3,recID:1,isOpening:4,filterForReady:5,filter:6,query:7,refStatus:8,praefix:9,selectionFields:10,showEdit:11,deList:12,newAllowed:13,prevEventId:14,inputSearch:15,shouldBlock:16},[-1,-1])}}const{document:document_1$f}=globals;function add_css$v(){var t=element("style");t.id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl .editRow.svelte-14hcfjl{width:1em}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",append(document_1$f.head,t)}function get_then_context$3(t){t[28]=t[30].list,t[29]=t[30].items}function get_each_context$d(t,e,n){const r=t.slice();return r[31]=e[n],r}function get_each_context_1$8(t,e,n){const r=t.slice();return r[34]=e[n],r}function get_each_context_2$5(t,e,n){const r=t.slice();return r[34]=e[n],r}function create_catch_block$b(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$b(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w;function $(e){t[25](e)}get_then_context$3(t),n=new t[7]({props:{outline:!0,$$slots:{default:[create_default_slot_1$c]},$$scope:{ctx:t}}}),n.$on("click",t[24]);let y={id:t[8]};void 0!==t[1]&&(y.value=t[1]),a=new t[6]({props:y}),binding_callbacks.push(()=>bind(a,"value",$)),a.$on("input",t[12]),d=new DeleteIcon({props:{size:"18"}});let b=t[29]?.length&&create_if_block_2$b(t),v=t[28]?.length&&create_if_block$v(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),o=element("div"),i=text("Suchen: "),create_component(a.$$.fragment),c=space(),l=element("span"),create_component(d.$$.fragment),u=space(),h=element("div"),m=element("table"),b&&b.c(),f=space(),p=element("tbody"),v&&v.c(),attr(e,"class","form--buttons svelte-14hcfjl"),attr(l,"class","feather pointer svelte-14hcfjl"),set_style(o,"margin-bottom","1em"),set_style(o,"position","relative"),attr(m,"striped",""),attr(m,"class","svelte-14hcfjl"),attr(h,"class","eList svelte-14hcfjl")},m(s,$){insert(s,e,$),mount_component(n,e,null),insert(s,r,$),insert(s,o,$),append(o,i),mount_component(a,o,null),append(o,c),append(o,l),mount_component(d,l,null),insert(s,u,$),insert(s,h,$),append(h,m),b&&b.m(m,null),append(m,f),append(m,p),v&&v.m(p,null),_=!0,g||(w=listen(l,"click",t[14]),g=!0)},p(t,e){get_then_context$3(t);const r={};256&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const o={};!s&&2&e[0]&&(s=!0,o.value=t[1],add_flush_callback(()=>s=!1)),a.$set(o),t[29]?.length&&b.p(t,e),t[28]?.length&&v.p(t,e)},i(t){_||(transition_in(n.$$.fragment,t),transition_in(a.$$.fragment,t),transition_in(d.$$.fragment,t),transition_in(v),_=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a.$$.fragment,t),transition_out(d.$$.fragment,t),transition_out(v),_=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),t&&detach(o),destroy_component(a),destroy_component(d),t&&detach(u),t&&detach(h),b&&b.d(),v&&v.d(),g=!1,w()}}}function create_default_slot_1$c(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_2$b(t){let e,n,r,o,i=t[29],a=[];for(let e=0;e<i.length;e+=1)a[e]=create_each_block_2$5(get_each_context_2$5(t,i,e));return{c(){e=element("thead"),n=element("tr"),r=element("th"),o=space();for(let t=0;t<a.length;t+=1)a[t].c();attr(r,"class","svelte-14hcfjl"),attr(n,"class","svelte-14hcfjl"),attr(e,"class","svelte-14hcfjl")},m(t,i){insert(t,e,i),append(e,n),append(n,r),append(n,o);for(let t=0;t<a.length;t+=1)a[t].m(n,null)},p(t,e){if(2048&e[0]){let r;for(i=t[29],r=0;r<i.length;r+=1){const o=get_each_context_2$5(t,i,r);a[r]?a[r].p(o,e):(a[r]=create_each_block_2$5(o),a[r].c(),a[r].m(n,null))}for(;r<a.length;r+=1)a[r].d(1);a.length=i.length}},d(t){t&&detach(e),destroy_each(a,t)}}}function create_each_block_2$5(t){let e,n,r=t[34]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$v(t){let e,n,r=t[28],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$d(get_each_context$d(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(44547&n[0]){let a;for(r=t[28],a=0;a<r.length;a+=1){const i=get_each_context$d(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$d(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block_1$j(t){let e,n,r,o,i,a,s,c;r=new ExternalLinkIcon({props:{size:"18"}});let l=t[29],d=[];for(let e=0;e<l.length;e+=1)d[e]=create_each_block_1$8(get_each_context_1$8(t,l,e));return{c(){e=element("tr"),n=element("td"),create_component(r.$$.fragment),o=space();for(let t=0;t<d.length;t+=1)d[t].c();i=space(),attr(n,"class","editRow svelte-14hcfjl"),attr(e,"class","pointer svelte-14hcfjl"),toggle_class(e,"active",t[31]._id===t[0])},m(l,u){insert(l,e,u),append(e,n),mount_component(r,n,null),append(e,o);for(let t=0;t<d.length;t+=1)d[t].m(e,null);append(e,i),a=!0,s||(c=listen(n,"click",t[15](t[31])),s=!0)},p(n,r){if(t=n,3584&r[0]){let n;for(l=t[29],n=0;n<l.length;n+=1){const o=get_each_context_1$8(t,l,n);d[n]?d[n].p(o,r):(d[n]=create_each_block_1$8(o),d[n].c(),d[n].m(e,i))}for(;n<d.length;n+=1)d[n].d(1);d.length=l.length}2049&r[0]&&toggle_class(e,"active",t[31]._id===t[0])},i(t){a||(transition_in(r.$$.fragment,t),a=!0)},o(t){transition_out(r.$$.fragment,t),a=!1},d(t){t&&detach(e),destroy_component(r),destroy_each(d,t),s=!1,c()}}}function create_each_block_1$8(t){let e,n,r,o,i=t[9](t[31],t[34])+"";return{c(){e=element("td"),n=text(i),attr(e,"class","svelte-14hcfjl")},m(i,a){insert(i,e,a),append(e,n),r||(o=listen(e,"click",stop_propagation(t[10](t[31]))),r=!0)},p(e,n){t=e},d(t){t&&detach(e),r=!1,o()}}}function create_each_block$d(t){let e,n,r=t[13](t[31],t[29],t[1]),o=r&&create_if_block_1$j(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){2&n[0]&&(r=t[13](t[31],t[29],t[1])),r?o?(o.p(t,n),2&n[0]&&transition_in(o,1)):(o=create_if_block_1$j(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_pending_block$b(t){let e,n;return e=new t[5]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$h(t){let e,n,r,o;e=new t[4]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$b,then:create_then_block$b,catch:create_catch_block$b,value:30,blocks:[,,,]};return handle_promise(t[11](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$z(t){let e,n;return e=new t[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[create_default_slot$h]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};3&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$z(t,e,n){const r=createEventDispatcher(),{Dialog:o,Divider:i,Loading:a,TextField:s,Button:c}=getAttractions;let{item:l}=e,{classId:d}=e,{className:u}=e,{rowId:h}=e,{viewName:m}=e,{viewValue:f}=e,{recordId:p}=e,{filter:_}=e,{multiValues:g}=e,w="",$=d+Math.floor(9e3*Math.random()+1e3).toString()+"search";const y=(t,e)=>{if(!e)return;const n=t[e.name];return"boolean"==typeof n?checkBoolean(n):checkDate(t[`_${e.name}`]||t[e.name]||"")},b=Request.getSchemaByClass(u);onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById($)?.focus()},200)}),task_notification.subscribe(async t=>{if(!t)return;const e=await b;t.eventId===e.id&&refreshList(e.class,t.eventId)});return t.$$set=t=>{"item"in t&&n(16,l=t.item),"classId"in t&&n(17,d=t.classId),"className"in t&&n(18,u=t.className),"rowId"in t&&n(0,h=t.rowId),"viewName"in t&&n(19,m=t.viewName),"viewValue"in t&&n(20,f=t.viewValue),"recordId"in t&&n(21,p=t.recordId),"filter"in t&&n(22,_=t.filter),"multiValues"in t&&n(23,g=t.multiValues)},[h,w,r,o,i,a,s,c,$,y,t=>()=>r("choose",{row:t}),async()=>{const t=await b;let e=[];if(l.lookup){const n="."+d+"#"+l.lookup,r=document.querySelector(n);let o=r?.value||p;if(g.has(l.lookup)){const n=g.get(l.lookup)[0];e=n?await Request.getSectionView(l.name,{[l.lookup]:n},!0):await getList(l.name,t.id)}else if(o&&24===o.toString().length){const t=await getTaskFull(l.lookup,o);if(t){const n=t[l.name]?.map(t=>t[l.name]);n&&(e=await Request.getSectionView(l.name,{_id:{$in:n}},!0))}}}else{const n="."+d+"#"+m.split(":")[0],r=document.querySelector(n);let o={[m]:r?.value||p};if(l.refItem){const t="."+d+"#"+l.refItem;try{const e=document.querySelector(t);if(e){const t={$or:[{[l.refItem]:e.value},{[l.refItem]:{$exists:!0,$eq:""}}]};o={...o,...t}}}catch{}}o[m]&&(e=await Request.getSectionView(t.class,o,!0)),_&&(e=e.filter(t=>t._id!=_))}const n=t.display;return{list:e,items:await getDisplayItems(n,t,e)}},({detail:{value:t}})=>{n(1,w=t)},(t,e,n)=>{if(!n)return!0;for(const r of e)if(y(t,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{n(1,w="")},t=>async()=>{const e=await Request.getTaskByDocId(t._id,!0),n=`/task/${e.event}/${e._id}/task?view=standalone`;window.open(n)},l,d,u,m,f,p,_,g,()=>r("back"),function(t){w=t,n(1,w)}]}class ViewList extends SvelteComponent{constructor(t){super(),document_1$f.getElementById("svelte-14hcfjl-style")||add_css$v(),init(this,t,instance$z,create_fragment$z,safe_not_equal,{item:16,classId:17,className:18,rowId:0,viewName:19,viewValue:20,recordId:21,filter:22,multiValues:23},[-1,-1])}}const{document:document_1$e}=globals;function add_css$u(){var t=element("style");t.id="svelte-jox15l-style",t.textContent=".feather.svelte-jox15l{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-jox15l{position:absolute;top:0.75em;right:0.5em;color:#4300b0}.text-field textarea:invalid{border-bottom:1px #b80000 solid !important;background-color:#fbeeee !important}",append(document_1$e.head,t)}function create_catch_block$a(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$a(t){let e,n,r=t[72]&&create_if_block$u(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,e){t[72]&&r.p(t,e)},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block$u(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$;function y(e){t[55](e)}function b(e){t[56](e)}let v={class:"full-width",id:t[32],rows:"1",required:t[2],disabled:t[3],placeholder:t[34],style:"height:2.8em; padding-left:2em;padding-right:2em;overflow-y:hidden; resize:none;"};void 0!==t[1]&&(v.value=t[1]),void 0!==t[25]&&(v.overwrite=t[25]),n=new TextArea({props:v}),binding_callbacks.push(()=>bind(n,"value",y)),binding_callbacks.push(()=>bind(n,"overwrite",b)),n.$on("click",t[37]()),n.$on("blur",t[44]);const I=[create_if_block_5$6,create_if_block_6$4],C=[];function E(t,e){return!t[3]||t[16]?0:t[22]&&t[0]?1:-1}~(a=E(t))&&(s=C[a]=I[a](t));let A=(!t[3]||t[16]||t[17])&&create_if_block_4$6(t);function S(e){t[57](e)}let k={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot_2$7]},$$scope:{ctx:t}};void 0!==t[19]&&(k.open=t[19]),m=new t[28]({props:k}),binding_callbacks.push(()=>bind(m,"open",S));let T=t[20]&&create_if_block_1$i(t);return{c(){e=element("div"),create_component(n.$$.fragment),i=space(),s&&s.c(),c=space(),l=element("input"),u=space(),A&&A.c(),h=space(),create_component(m.$$.fragment),p=space(),T&&T.c(),_=empty(),attr(l,"class",d=null_to_empty(t[9]||t[10])+" svelte-jox15l"),attr(l,"id",t[5]),attr(l,"name",t[5]),l.value=t[0],l.hidden=!0,set_style(e,"position","relative")},m(r,o){insert(r,e,o),mount_component(n,e,null),append(e,i),~a&&C[a].m(e,null),append(e,c),append(e,l),append(e,u),A&&A.m(e,null),insert(r,h,o),mount_component(m,r,o),insert(r,p,o),T&&T.m(r,o),insert(r,_,o),g=!0,w||($=listen(e,"keydown",t[38]),w=!0)},p(t,i){const u={};4&i[0]&&(u.required=t[2]),8&i[0]&&(u.disabled=t[3]),!r&&2&i[0]&&(r=!0,u.value=t[1],add_flush_callback(()=>r=!1)),!o&&33554432&i[0]&&(o=!0,u.overwrite=t[25],add_flush_callback(()=>o=!1)),n.$set(u);let h=a;a=E(t),a===h?~a&&C[a].p(t,i):(s&&(group_outros(),transition_out(C[h],1,1,()=>{C[h]=null}),check_outros()),~a?(s=C[a],s?s.p(t,i):(s=C[a]=I[a](t),s.c()),transition_in(s,1),s.m(e,c)):s=null),(!g||1536&i[0]&&d!==(d=null_to_empty(t[9]||t[10])+" svelte-jox15l"))&&attr(l,"class",d),(!g||32&i[0])&&attr(l,"id",t[5]),(!g||32&i[0])&&attr(l,"name",t[5]),(!g||1&i[0]&&l.value!==t[0])&&(l.value=t[0]),!t[3]||t[16]||t[17]?A?(A.p(t,i),196616&i[0]&&transition_in(A,1)):(A=create_if_block_4$6(t),A.c(),transition_in(A,1),A.m(e,null)):A&&(group_outros(),transition_out(A,1,1,()=>{A=null}),check_outros());const p={};93126097&i[0]|2048&i[2]&&(p.$$scope={dirty:i,ctx:t}),!f&&524288&i[0]&&(f=!0,p.open=t[19],add_flush_callback(()=>f=!1)),m.$set(p),t[20]?T?(T.p(t,i),1048576&i[0]&&transition_in(T,1)):(T=create_if_block_1$i(t),T.c(),transition_in(T,1),T.m(_.parentNode,_)):T&&(group_outros(),transition_out(T,1,1,()=>{T=null}),check_outros())},i(t){g||(transition_in(n.$$.fragment,t),transition_in(s),transition_in(A),transition_in(m.$$.fragment,t),transition_in(T),g=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(s),transition_out(A),transition_out(m.$$.fragment,t),transition_out(T),g=!1},d(t){t&&detach(e),destroy_component(n),~a&&C[a].d(),A&&A.d(),t&&detach(h),destroy_component(m,t),t&&detach(p),T&&T.d(t),t&&detach(_),w=!1,$()}}}function create_if_block_6$4(t){let e,n,r,o,i;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-jox15l")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[43]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_5$6(t){let e,n,r,o,i;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-jox15l")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=[listen(e,"click",t[37](!0)),listen(e,"choose",t[40])],o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,run_all(i)}}}function create_if_block_4$6(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 pointer svelte-jox15l")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[42]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_2$a(t){let e,n,r,o;const i=[create_if_block_3$6,create_else_block$f],a=[];function s(t,e){return t[6].lookup||t[4]&&!t[6].constraint?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_else_block$f(t){let e,n;return e=new FormList({props:{title:t[6].designation,newAllowed:t[23],prevEventId:t[11],schema:t[18],filter:t[33],query:t[35](),record:t[7],recID:t[0],isOpening:t[19],filterForReady:t[24],refStatus:t[6].refStatus,selectionFields:t[14],deList:t[15],praefix:t[13],shouldBlock:t[26],inputSearch:t[39]()}}),e.$on("choose",t[40]),e.$on("back",t[41]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.title=t[6].designation),8388608&n[0]&&(r.newAllowed=t[23]),2048&n[0]&&(r.prevEventId=t[11]),262144&n[0]&&(r.schema=t[18]),128&n[0]&&(r.record=t[7]),1&n[0]&&(r.recID=t[0]),524288&n[0]&&(r.isOpening=t[19]),16777216&n[0]&&(r.filterForReady=t[24]),64&n[0]&&(r.refStatus=t[6].refStatus),16384&n[0]&&(r.selectionFields=t[14]),32768&n[0]&&(r.deList=t[15]),8192&n[0]&&(r.praefix=t[13]),67108864&n[0]&&(r.shouldBlock=t[26]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_3$6(t){let e,n;return e=new ViewList({props:{item:t[6],className:t[18].class,classId:t[10],rowId:t[0],recordId:t[12],viewName:t[4],viewValue:"",multiValues:t[8]}}),e.$on("choose",t[40]),e.$on("back",t[41]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.item=t[6]),262144&n[0]&&(r.className=t[18].class),1024&n[0]&&(r.classId=t[10]),1&n[0]&&(r.rowId=t[0]),4096&n[0]&&(r.recordId=t[12]),16&n[0]&&(r.viewName=t[4]),256&n[0]&&(r.multiValues=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$7(t){let e,n,r=t[19]&&create_if_block_2$a(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[19]?r?(r.p(t,n),524288&n[0]&&transition_in(r,1)):(r=create_if_block_2$a(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_1$i(t){let e,n,r;function o(e){t[58](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$g]},$$scope:{ctx:t}};return void 0!==t[20]&&(i.open=t[20]),e=new t[28]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};2359297&r[0]|2048&r[2]&&(o.$$scope={dirty:r,ctx:t}),!n&&1048576&r[0]&&(n=!0,o.open=t[20],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$b(t){let e,n;return e=new Index({props:{schema:t[18],recID:t[0],readonly:!0}}),e.$on("back",t[41]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};262144&n[0]&&(r.schema=t[18]),1&n[0]&&(r.recID=t[0]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$g(t){let e,n;return e=new t[27]({props:{title:t[21],$$slots:{default:[create_default_slot_1$b]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2097152&n[0]&&(r.title=t[21]),262145&n[0]|2048&n[2]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_pending_block$a(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$y(t){let e,n,r={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$a,then:create_then_block$a,catch:create_catch_block$a,value:72,blocks:[,,,]};return handle_promise(t[36](),r),{c(){e=empty(),r.block.c()},m(t,o){insert(t,e,o),r.block.m(t,r.anchor=o),r.mount=()=>e.parentNode,r.anchor=e,n=!0},p(e,n){update_await_block_branch(r,t=e,n)},i(t){n||(transition_in(r.block),n=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(r.blocks[t])}n=!1},d(t){t&&detach(e),r.block.d(t),r.token=null,r=null}}}function instance$y(t,e,n){let r,o,i,a;component_subscribe(t,currentRoles,t=>n(54,r=t));const s=createEventDispatcher(),{Dialog:c,Modal:l}=getAttractions,{currentTasks:d,environment:u,loggedIn:h}=user;component_subscribe(t,d,t=>n(60,o=t)),component_subscribe(t,u,t=>n(62,a=t)),component_subscribe(t,h,t=>n(61,i=t));let{id:m}=e,{item:f}=e,{fullRecord:p}=e,{value:_=""}=e,{multiValues:g}=e,{desc:w=""}=e,{noForm:$=!1}=e,{classId:y}=e,{eventId:b}=e,{recordId:v}=e,{withRefValue:I=!1}=e,{refValue:C=""}=e,{shortEdit:E}=e,{required:A}=e,{disabled:S}=e,{readonly:k}=e,{praefix:T}=e,{selectionFields:R}=e,{formnovalidate:N}=e,{selection:D}=e,{deList:x}=e,{isTemplate:O}=e,{noList:M=!1}=e,{multi:P=!1}=e,{initFinished:B}=e;const F="comment_"+m,L=f.filter;let q,V,H,U,z,W,j=!1,G=!0,X=!0,Q=!0,Y=!1,Z="";k||=v&&f.asInput,S||=k,!D&&f.selection&&1===f.selection.split(":").length&&(D=f.selection);const K=k||S||f.lookup||D&&!f.constraint?"":"Suchbegriff ⏎",J=()=>{f.refItem&&f.refItem.startsWith("owner")&&(n(46,C=a.owner[f.refClass]),C||n(46,C=((t,e)=>{try{return t.split(".").reduce((t,e)=>t[e],e)}catch(t){return""}})(f.refItem,a)),C&&(n(45,I=!0),s("change",{value:C})))},tt=async t=>{t.items.filter(t=>t.properties?.default).forEach(e=>{s("defPrep",{className:t.class,itemName:e.name,value:e.properties.default})})},et=async t=>{const e=()=>{n(19,j=!0)};if(9==t.which)return;if(_)return t.preventDefault();if(13!=t.which)return;t.preventDefault();const r=H.items.find(t=>t.properties?.search);if(!r)return e();const o=t.srcElement.value,{name:i,checkOn:a,refClass:s,properties:c}=r;let{search:l}=c;!0===l&&(l={}),"number"==typeof l&&(l={min:l});const{min:d=3,start:u=!1,end:h=!1}=l;if(o.length<d)return e();const m=(u?"^":"")+o+(h?"$":"");let f={[i]:{$regex:m,$options:"i"}};a&&(f=[{$lookup:{from:s,localField:i,foreignField:"_id",as:s}},{$match:{[s+"."+a]:{$regex:m,$options:"i"}}}]);const p=await Request.getSectionView(H.class,f);1!==p?.length?e():n(0,_=p[0]._id)},nt=t=>{t&&(n(53,Z=n(1,w=getRecordDescription(H,t))),s("setRefDesc",w.split(" •")[0]),s("change",{value:_,description:w}),s("task",{row:t,eventId:H.id}))},rt=()=>{n(19,j=!1),n(20,q=!1)};return t.$$set=t=>{"id"in t&&n(5,m=t.id),"item"in t&&n(6,f=t.item),"fullRecord"in t&&n(7,p=t.fullRecord),"value"in t&&n(0,_=t.value),"multiValues"in t&&n(8,g=t.multiValues),"desc"in t&&n(1,w=t.desc),"noForm"in t&&n(9,$=t.noForm),"classId"in t&&n(10,y=t.classId),"eventId"in t&&n(11,b=t.eventId),"recordId"in t&&n(12,v=t.recordId),"withRefValue"in t&&n(45,I=t.withRefValue),"refValue"in t&&n(46,C=t.refValue),"shortEdit"in t&&n(49,E=t.shortEdit),"required"in t&&n(2,A=t.required),"disabled"in t&&n(3,S=t.disabled),"readonly"in t&&n(48,k=t.readonly),"praefix"in t&&n(13,T=t.praefix),"selectionFields"in t&&n(14,R=t.selectionFields),"formnovalidate"in t&&n(50,N=t.formnovalidate),"selection"in t&&n(4,D=t.selection),"deList"in t&&n(15,x=t.deList),"isTemplate"in t&&n(16,O=t.isTemplate),"noList"in t&&n(51,M=t.noList),"multi"in t&&n(17,P=t.multi),"initFinished"in t&&n(47,B=t.initFinished)},t.$$.update=()=>{if(4&t.$$.dirty[0]|524288&t.$$.dirty[1]&&n(2,A=A&&!N),49152&t.$$.dirty[1]&&I&&n(0,_=C),3&t.$$.dirty[0]|4194304&t.$$.dirty[1]&&!w&&_&&Z&&n(1,w=Z),399425&t.$$.dirty[0]|1114112&t.$$.dirty[1]&&_&&H){let t=!1;if(!Array.isArray(_)){const e=f.properties?.prefetch?500:0;if(v||f.asInput||f.upate||!1!==f.refItem||!0===P||!1===f.refItem&&B)if(e){const e="p$"+f.refClass+"$"+b,n=getList2(e);n?n.then(t=>{const e=t.find(({_id:t})=>t===_);e?nt(e):getTask(f.refClass,H.id,_,!!f.lookup||M).then(nt)}):t=!0}else t=!0;t&&getTask(f.refClass,H.id,_,!!f.lookup||M).then(nt),n(47,B=!0)}}if(65&t.$$.dirty[0]|10485760&t.$$.dirty[1]&&_&&U&&f.name===U.input?.at(0)&&U.inputLookup?.length){const{domain:t}=U.inputLookup[0]||{};"user"===t&&(r.some(t=>U.authorization?.find(e=>e.role===t&&!e.constraint))||n(3,S=!0))}262145&t.$$.dirty[0]&&!_&&H&&nt({})},[_,w,A,S,D,m,f,p,g,$,y,b,v,T,R,x,O,P,H,j,q,V,z,G,X,Q,Y,c,l,d,u,h,F,L,K,()=>{if(!f.query)return;const[t,e]=f.query.split(".");if(!p[e])return;let n=[{$lookup:{from:t,localField:t,foreignField:"_id",as:"__"+t}},{$unwind:{path:"$__"+t,preserveNullAndEmptyArrays:!0}},{$match:{["__"+t+"."+e]:p[e]}}];return f.refStatus&&(n=n.concat([{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":f.refStatus}}])),n},async()=>{try{const t=await Request.getEvent(b);if(W="report"===t.output.type,n(24,X=!f.asInput),n(23,G=t.output?.class[0].name!==f.refClass),n(18,H=await Request.getSchemaByClass(f.refClass)),H?.blocked)return s("initFail",!0),!1;if(W||n(26,Y=((t,e)=>{let n=e.items.find(t=>!!t.properties?.blocking);if(!n)return!1;if(t.input?.class?.find(t=>t.name===e.class))return n.name;const r=t.output?.class.at(0)?.list||[];for(const t of r){const e=t.item.find(t=>t.name===f.name);if(e?.properties?.blocking)return n.name}return!1})(t,H)),tt(H),n(22,z=(t=>!o?.length||!!o.find(e=>e===t))(H.id)),n(52,U=await Request.getSchema(b)),b&&v&&_&&!S&&U.input?.find(t=>t===f.refClass)&&n(3,S=!0),t.input?.class&&t.input.class[0]&&(t.input.class[0].name===f.refClass&&t.input.class[0].readonly&&n(3,S=!0),v&&t.input.class[0].name===f.refClass&&t.input.class[0].writeState)){(await Request.getTaskByDocId(v,!0)).status===t.input.class[0].writeState&&n(3,S=n(48,k=!1))}if(f.properties?.query?.lookup){const{domain:t,value:e}=f.properties.query.lookup;if("user"===t){const t=i.user,o={[e]:t},a=await Request.getSectionView(f.refClass,o);if(a?.length){const[{_id:t}]=a;t&&(n(46,C=t),n(45,I=!0),s("change",{value:C}))}r.some(t=>H.authorization?.find(e=>e.role===t&&!e.constraint))||n(3,S=!0)}}else J();if(!C&&f.filter&&(""===T||void 0===T)){const t=f.filter,e=!0;t.startsWith("!")&&(e=!1,t=t.slice(1));const r=await Request.getOneAndOnly(f.refClass,{[f.filter]:e});r&&(n(46,C=r._id),n(45,I=!0),s("change",{value:C}))}return n(21,V=H.identity.designation),!0}catch{return s("initFail",!0),!1}},t=>e=>{if(e.stopPropagation(),!0===t&&n(19,j=!0),t&&"BUTTON"===e.explicitOriginalTarget?.nodeName){const e=document.getElementById(t);return e?.blur()}(f.lookup||D&&!f.constraint||_)&&n(19,j=!0)},et,()=>{if(_)return"";const t=document.getElementById(F);return n(1,w=""),t?.value||""},({detail:t})=>{n(0,_=t.row._id),rt()},rt,()=>{(W||z)&&(P?s("change",{value:_,delete:!0}):(n(0,_=""),n(1,w=""),n(25,Q=!0),s("change",{value:_,description:w}),s("task",{row:{_task:{event:H.id,_id:!1}}})))},async()=>{if(!_)return;let t=await getTask(f.refClass,H.id,_);t._task||(t={_task:await Request.getTaskByDocId(_,!0)});const e=t._task.task_id||t._task._id,n=`/task/${t._task.event}/${e}/task?view=standalone`;window.open(n)},t=>{_||w&&et({which:13,preventDefault:()=>{},srcElement:{value:w}})},I,C,B,k,E,N,M,U,Z,r,function(t){w=t,n(1,w),n(0,_),n(53,Z),n(45,I),n(46,C)},function(t){Q=t,n(25,Q)},function(t){j=t,n(19,j)},function(t){q=t,n(20,q)}]}class InputReference extends SvelteComponent{constructor(t){super(),document_1$e.getElementById("svelte-jox15l-style")||add_css$u(),init(this,t,instance$y,create_fragment$y,safe_not_equal,{id:5,item:6,fullRecord:7,value:0,multiValues:8,desc:1,noForm:9,classId:10,eventId:11,recordId:12,withRefValue:45,refValue:46,shortEdit:49,required:2,disabled:3,readonly:48,praefix:13,selectionFields:14,formnovalidate:50,selection:4,deList:15,isTemplate:16,noList:51,multi:17,initFinished:47},[-1,-1,-1])}}function add_css$t(){var t=element("style");t.id="svelte-1m792ni-style",t.textContent=".field .card{padding:1em !important;margin-bottom:1em !important}",append(document.head,t)}function get_each_context$c(t,e,n){const r=t.slice();return r[40]=e[n],r[42]=n,r}function create_catch_block$9(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$9(t){let e,n;return e=new t[16]({props:{outline:!0,$$slots:{default:[create_default_slot_3$2]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8191&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_1$h(t){let e,n,r,o,i;return n=new ListIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",function(){is_function(t[22](t[0]))&&t[22](t[0]).apply(this,arguments)}),o=!0)},p(e,n){t=e},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block$c(t){let e,n;return e=new InputReference({props:{classId:t[6],eventId:t[7],required:t[9],disabled:t[1],formnovalidate:t[12],readonly:t[10],id:t[2]+"."+t[42],item:t[3],desc:t[4],value:t[40],noForm:t[5],praefix:t[11],recordId:t[8],multi:!0}}),e.$on("change",t[24]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.classId=t[6]),128&n[0]&&(r.eventId=t[7]),512&n[0]&&(r.required=t[9]),2&n[0]&&(r.disabled=t[1]),4096&n[0]&&(r.formnovalidate=t[12]),1024&n[0]&&(r.readonly=t[10]),4&n[0]&&(r.id=t[2]+"."+t[42]),8&n[0]&&(r.item=t[3]),16&n[0]&&(r.desc=t[4]),1&n[0]&&(r.value=t[40]),32&n[0]&&(r.noForm=t[5]),2048&n[0]&&(r.praefix=t[11]),256&n[0]&&(r.recordId=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_3$2(t){let e,n,r,o=!t[10]&&create_if_block_1$h(t),i=[].concat(t[0]),a=[];for(let e=0;e<i.length;e+=1)a[e]=create_each_block$c(get_each_context$c(t,i,e));const s=t=>transition_out(a[t],1,1,()=>{a[t]=null});return{c(){o&&o.c(),e=space();for(let t=0;t<a.length;t+=1)a[t].c();n=empty()},m(t,i){o&&o.m(t,i),insert(t,e,i);for(let e=0;e<a.length;e+=1)a[e].m(t,i);insert(t,n,i),r=!0},p(t,r){if(t[10]?o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros()):o?(o.p(t,r),1024&r[0]&&transition_in(o,1)):(o=create_if_block_1$h(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)),16785407&r[0]){let e;for(i=[].concat(t[0]),e=0;e<i.length;e+=1){const o=get_each_context$c(t,i,e);a[e]?(a[e].p(o,r),transition_in(a[e],1)):(a[e]=create_each_block$c(o),a[e].c(),transition_in(a[e],1),a[e].m(n.parentNode,n))}for(group_outros(),e=i.length;e<a.length;e+=1)s(e);check_outros()}},i(t){if(!r){transition_in(o);for(let t=0;t<i.length;t+=1)transition_in(a[t]);r=!0}},o(t){transition_out(o),a=a.filter(Boolean);for(let t=0;t<a.length;t+=1)transition_out(a[t]);r=!1},d(t){o&&o.d(t),t&&detach(e),destroy_each(a,t),t&&detach(n)}}}function create_pending_block$9(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_if_block$t(t){let e,n;return e=new t[18]({props:{title:t[14].designation,class:"eList",$$slots:{default:[create_default_slot_1$a]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16384&n[0]&&(r.title=t[14].designation),49480&n[0]|4096&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$6(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_1$a(t){let e,n,r,o,i;return n=new t[19]({props:{outline:!0,$$slots:{default:[create_default_slot_2$6]},$$scope:{ctx:t}}}),n.$on("click",t[25]),o=new List$1({props:{item:t[3],className:t[14].class,classId:t[6],rowId:t[15],recordId:t[8],inputList:t[21]()}}),o.$on("choose",t[23]),o.$on("back",t[25]),{c(){e=element("div"),create_component(n.$$.fragment),r=space(),create_component(o.$$.fragment),attr(e,"class","form--buttons")},m(t,a){insert(t,e,a),mount_component(n,e,null),insert(t,r,a),mount_component(o,t,a),i=!0},p(t,e){const r={};4096&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const i={};8&e[0]&&(i.item=t[3]),16384&e[0]&&(i.className=t[14].class),64&e[0]&&(i.classId=t[6]),32768&e[0]&&(i.rowId=t[15]),256&e[0]&&(i.recordId=t[8]),o.$set(i)},i(t){i||(transition_in(n.$$.fragment,t),transition_in(o.$$.fragment,t),i=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(o.$$.fragment,t),i=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),destroy_component(o,t)}}}function create_default_slot$f(t){let e,n,r=t[13]&&create_if_block$t(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[13]?r?(r.p(t,n),8192&n[0]&&transition_in(r,1)):(r=create_if_block$t(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_fragment$x(t){let e,n,r,o,i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$9,then:create_then_block$9,catch:create_catch_block$9,value:39,blocks:[,,,]};function a(e){t[34](e)}handle_promise(t[20](),i);let s={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$f]},$$scope:{ctx:t}};return void 0!==t[13]&&(s.open=t[13]),n=new t[17]({props:s}),binding_callbacks.push(()=>bind(n,"open",a)),{c(){i.block.c(),e=space(),create_component(n.$$.fragment)},m(t,r){i.block.m(t,i.anchor=r),i.mount=()=>e.parentNode,i.anchor=e,insert(t,e,r),mount_component(n,t,r),o=!0},p(e,o){update_await_block_branch(i,t=e,o);const a={};57672&o[0]|4096&o[1]&&(a.$$scope={dirty:o,ctx:t}),!r&&8192&o[0]&&(r=!0,a.open=t[13],add_flush_callback(()=>r=!1)),n.$set(a)},i(t){o||(transition_in(i.block),transition_in(n.$$.fragment,t),o=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}transition_out(n.$$.fragment,t),o=!1},d(t){i.block.d(t),i.token=null,i=null,t&&detach(e),destroy_component(n,t)}}}function instance$x(t,e,n){const r=createEventDispatcher(),{Card:o,Modal:i,Dialog:a,Button:s}=getAttractions;let c,l,{id:d}=e,{item:u}=e,{record:h}=e,{values:m=[]}=e,{desc:f=""}=e,{noForm:p=!1}=e,{classId:_}=e,{eventId:g}=e,{recordId:w}=e,{withRefValue:$=!1}=e,{refValue:y=""}=e,{required:b}=e,{disabled:v}=e,{readonly:I}=e,{praefix:C}=e,{selectionFields:E}=e,{formnovalidate:A}=e,{selection:S}=e,{deList:k}=e,{isTemplate:T}=e,{noList:R=!1}=e,N=!1;const{lookup:D,filter:x,constraint:O}=u.properties.multi;v=!0;const M=()=>{n(13,N=!1)};return t.$$set=t=>{"id"in t&&n(2,d=t.id),"item"in t&&n(3,u=t.item),"record"in t&&n(26,h=t.record),"values"in t&&n(0,m=t.values),"desc"in t&&n(4,f=t.desc),"noForm"in t&&n(5,p=t.noForm),"classId"in t&&n(6,_=t.classId),"eventId"in t&&n(7,g=t.eventId),"recordId"in t&&n(8,w=t.recordId),"withRefValue"in t&&n(27,$=t.withRefValue),"refValue"in t&&n(28,y=t.refValue),"required"in t&&n(9,b=t.required),"disabled"in t&&n(1,v=t.disabled),"readonly"in t&&n(10,I=t.readonly),"praefix"in t&&n(11,C=t.praefix),"selectionFields"in t&&n(29,E=t.selectionFields),"formnovalidate"in t&&n(12,A=t.formnovalidate),"selection"in t&&n(30,S=t.selection),"deList"in t&&n(31,k=t.deList),"isTemplate"in t&&n(32,T=t.isTemplate),"noList"in t&&n(33,R=t.noList)},[m,v,d,u,f,p,_,g,w,b,I,C,A,N,c,l,o,i,a,s,async()=>{n(0,m=[].concat(m)),n(14,c=await Request.getSchemaByClass(u.refClass))},async()=>{let t=await getList(c.class,c.id);if(!t?.length)return[];if(D&&(t=t.filter(t=>h[D]===t[D])),O&&t?.length){const{refClass:e,refStatus:n}=O,r=[{$match:{[c.class]:{$in:t.map(({_id:t})=>t)}}},{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:{"_task.status":n}}],o=await Request.getSectionView(e,r);t=t.filter(t=>!!o.find(e=>e.project==t._id))}if(x)for(const e in x)t=t.filter(t=>{let[n,r]=e.split(".");if(r||(r=n,n=""),n){if(t[n][0]&&t[n][0][r].length)return!0}else if(t[r])return!0;return!1});return t},t=>()=>{I||(t=[].concat(t),n(13,N=!0),n(15,l=t))},({detail:t})=>{const e=t.row._id;n(0,m=[].concat(m)),Array.isArray(m)&&!m.find(t=>t===e)&&n(0,m=m.concat(t.row._id)),M()},({detail:t})=>{n(0,m=[].concat(m)),t.delete&&n(0,m=m.filter(e=>e!==t.value)),t.value=m,r("change",t),r("multi",{lookup:D,filter:x,name:u.name,value:m})},M,h,$,y,E,S,k,T,R,function(t){N=t,n(13,N)}]}class InputReferenceMulti extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-1m792ni-style")||add_css$t(),init(this,t,instance$x,create_fragment$x,safe_not_equal,{id:2,item:3,record:26,values:0,desc:4,noForm:5,classId:6,eventId:7,recordId:8,withRefValue:27,refValue:28,required:9,disabled:1,readonly:10,praefix:11,selectionFields:29,formnovalidate:12,selection:30,deList:31,isTemplate:32,noList:33},[-1,-1])}}const numberRegex=/\d+/g,formatSpecifierRegex=/%[HMSpPdmyY%]/g;function parseDateTime(t,e,n){const r=Math.floor((new Date).getFullYear()/100);let o=!1;if(""===t)return null;const i=e.split(formatSpecifierRegex);let a=0,s=0;const c=new Date(0);for(const l of i){if(!t.startsWith(l,a))return n;if(a+=l.length,a===t.length){if(s!==e.length)return n;break}if("%"!==e[s+l.length])break;if(s+=l.length+1,"%"===e[s]){if("%"!==t[a])return n;a++}else if("p"===e[s].toLowerCase()){const e=t.substr(a,2).toUpperCase();if("AM"===e)o=!1,c.getHours()>=12&&c.setHours(c.getHours()-12);else{if("PM"!==e)return n;o=!0,c.getHours()<12&&c.setHours(c.getHours()+12)}}else{numberRegex.lastIndex=a;const i=numberRegex.exec(t);if(null==i)return n;switch(e[s]){case"H":c.setHours(parseInt(i[0])+12*o);break;case"M":c.setMinutes(i[0]);break;case"S":c.setSeconds(i[0]);break;case"d":c.setDate(i[0]);break;case"m":c.setMonth(i[0]-1);break;case"y":c.setFullYear(100*r+parseInt(i[0]));break;case"Y":c.setFullYear(i[0])}a+=i[0].length}s++}return isNaN(c.valueOf())?n:c}function formatDateTime(t,e){if(null==t)return null;let n=t.getHours();return/%p/i.test(e)&&(n%=12,0===n&&(n=12)),e.replace("%Y",t.getFullYear()).replace("%y",(t.getFullYear()%100).toString().padStart(2,"0")).replace("%m",(t.getMonth()+1).toString().padStart(2,"0")).replace("%d",t.getDate().toString().padStart(2,"0")).replace("%H",n.toString().padStart(2,"0")).replace("%M",t.getMinutes().toString().padStart(2,"0")).replace("%S",t.getSeconds().toString().padStart(2,"0")).replace("%p",t.getHours()<12?"am":"pm").replace("%P",t.getHours()<12?"AM":"PM").replace("%%","%")}function applyDate(t,e){return null==t||null==e?t:(e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),e)}function applyTime(t,e){return null==t||null==e?t:(e.setHours(t.getHours(),t.getMinutes(),t.getSeconds()),e)}const{document:document_1$d}=globals;function add_css$s(){var t=element("style");t.id="svelte-1phofh5-style",t.textContent="form.svelte-1phofh5.svelte-1phofh5{min-width:25em}@media only screen and (min-width: 600px){form.svelte-1phofh5.svelte-1phofh5{min-width:30em}}.fEmbedded.svelte-1phofh5.svelte-1phofh5,.fTask.svelte-1phofh5.svelte-1phofh5{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-1phofh5.svelte-1phofh5{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-1phofh5.svelte-1phofh5{height:fit-content;max-height:70vh}.sTask.svelte-1phofh5.svelte-1phofh5{height:95%;display:inline-grid;min-width:40em}.sTask.svelte-1phofh5 .btn.svelte-1phofh5{display:initial !important}.form--buttons.svelte-1phofh5.svelte-1phofh5{display:flex;gap:1em;padding-bottom:0.5em}",append(document_1$d.head,t)}function get_each_context$b(t,e,n){const r=t.slice();return r[17]=e[n],r}function get_each_context_1$7(t,e,n){const r=t.slice();return r[20]=e[n],r}function create_catch_block$8(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$8(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f=t[0].items,p=[];for(let e=0;e<f.length;e+=1)p[e]=create_each_block_1$7(get_each_context_1$7(t,f,e));const _=t=>transition_out(p[t],1,1,()=>{p[t]=null});let g=t[0].list&&create_if_block$s(t);return c=new t[5]({props:{outline:!0,$$slots:{default:[create_default_slot_1$9]},$$scope:{ctx:t}}}),c.$on("click",t[9]),d=new t[5]({props:{disabled:t[2],class:"close",form:t[6],filled:!0,type:"submit",$$slots:{default:[create_default_slot$e]},$$scope:{ctx:t}}}),{c(){e=element("form"),n=element("input"),o=space();for(let t=0;t<p.length;t+=1)p[t].c();i=space(),g&&g.c(),a=space(),s=element("div"),create_component(c.$$.fragment),l=space(),create_component(d.$$.fragment),attr(n,"class",null_to_empty(t[6])+" svelte-1phofh5"),attr(n,"name","_id"),attr(n,"type","hidden"),n.value=r=t[1]._id||"",attr(e,"class","fTask svelte-1phofh5"),attr(e,"id",t[6]),attr(s,"class","form--buttons svelte-1phofh5")},m(r,f){insert(r,e,f),append(e,n),append(e,o);for(let t=0;t<p.length;t+=1)p[t].m(e,null);append(e,i),g&&g.m(e,null),insert(r,a,f),insert(r,s,f),mount_component(c,s,null),append(s,l),mount_component(d,s,null),u=!0,h||(m=[listen(e,"keydown",t[8]),listen(e,"submit",prevent_default(t[10]))],h=!0)},p(t,o){if((!u||2&o&&r!==(r=t[1]._id||""))&&(n.value=r),75&o){let n;for(f=t[0].items,n=0;n<f.length;n+=1){const r=get_each_context_1$7(t,f,n);p[n]?(p[n].p(r,o),transition_in(p[n],1)):(p[n]=create_each_block_1$7(r),p[n].c(),transition_in(p[n],1),p[n].m(e,i))}for(group_outros(),n=f.length;n<p.length;n+=1)_(n);check_outros()}t[0].list?g?(g.p(t,o),1&o&&transition_in(g,1)):(g=create_if_block$s(t),g.c(),transition_in(g,1),g.m(e,null)):g&&(group_outros(),transition_out(g,1,1,()=>{g=null}),check_outros());const a={};8388608&o&&(a.$$scope={dirty:o,ctx:t}),c.$set(a);const s={};4&o&&(s.disabled=t[2]),8388608&o&&(s.$$scope={dirty:o,ctx:t}),d.$set(s)},i(t){if(!u){for(let t=0;t<f.length;t+=1)transition_in(p[t]);transition_in(g),transition_in(c.$$.fragment,t),transition_in(d.$$.fragment,t),u=!0}},o(t){p=p.filter(Boolean);for(let t=0;t<p.length;t+=1)transition_out(p[t]);transition_out(g),transition_out(c.$$.fragment,t),transition_out(d.$$.fragment,t),u=!1},d(t){t&&detach(e),destroy_each(p,t),g&&g.d(),t&&detach(a),t&&detach(s),destroy_component(c),destroy_component(d),h=!1,run_all(m)}}}function create_if_block_1$g(t){let e,n;return e=new InputFormField({props:{classId:t[6],item:t[20],selection:t[20].selection,record:t[1],disabled:t[3],eventId:t[0].id,required:!1,isTemplate:!0}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n&&(r.item=t[20]),1&n&&(r.selection=t[20].selection),2&n&&(r.record=t[1]),8&n&&(r.disabled=t[3]),1&n&&(r.eventId=t[0].id),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_1$7(t){let e,n,r=checkType(!0,t[20]),o=r&&create_if_block_1$g(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){1&n&&(r=checkType(!0,t[20])),r?o?(o.p(t,n),1&n&&transition_in(o,1)):(o=create_if_block_1$g(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_if_block$s(t){let e,n,r=t[0].list,o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$b(get_each_context$b(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(75&n){let a;for(r=t[0].list,a=0;a<r.length;a+=1){const i=get_each_context$b(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$b(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_each_block$b(t){let e,n,r,o;return e=new t[4]({props:{text:t[17].designation}}),r=new InputObject({props:{classId:t[6],list:t[17],eventId:t[0].id,schema:t[17].item,record:t[1],disabled:t[3],required:!1,open:!0,isTemplate:!0}}),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};1&n&&(o.text=t[17].designation),e.$set(o);const i={};1&n&&(i.list=t[17]),1&n&&(i.eventId=t[0].id),1&n&&(i.schema=t[17].item),2&n&&(i.record=t[1]),8&n&&(i.disabled=t[3]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_default_slot_1$9(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot$e(t){let e;return{c(){e=text("Speichern")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_pending_block$8(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$w(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$8,then:create_then_block$8,catch:create_catch_block$8,value:16,blocks:[,,,]};return handle_promise(t[7](),o),{c(){e=space(),n=element("section"),o.block.c(),document_1$d.title="Vorgaben",attr(n,"class","sTask svelte-1phofh5")},m(t,i){insert(t,e,i),insert(t,n,i),o.block.m(n,o.anchor=null),o.mount=()=>n,o.anchor=null,r=!0},p(e,[n]){update_await_block_branch(o,t=e,n)},i(t){r||(transition_in(o.block),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}r=!1},d(t){t&&detach(e),t&&detach(n),o.block.d(),o.token=null,o=null}}}const checkType=(t,{type:e="",properties:n={}})=>!t||"list"!==e&&("time"===n.format&&(e="time"),!["date","datetime","time"].includes(e)&&(!n.readonly&&!n.hidden));function instance$w(t,e,n){let r,o,i;component_subscribe(t,settings,t=>n(11,o=t)),component_subscribe(t,currentRoles,t=>n(12,i=t));const{Divider:a,Button:s,FormField:c}=getAttractions,l=JSON.parse(Storage.getItem("Locale"));let{schema:d}=e,{record:u}=e,h="template-"+d.class+Math.floor(9e3*Math.random()+1e3).toString(),m=!1;const f=()=>window.history.back(),p=(t,e,n=!1)=>{const r=e.id,o=t.find(t=>t.name===r);let i=e.value;if(!n&&o&&o.properties?.multi&&(i=u[r]),i&&o&&o.type.startsWith("date"))try{return parseDateTime(i,"%d.%m.%Y").toISOString()}catch{return new Date(i).toISOString()}if(o&&"boolean"===o.type&&(i=!!e.checked),o&&"number"===o.type){const t=Number("1.1").toLocaleString(l.id).substring(1,2);try{i=Number(i.replace(t,".")).toString()}catch{}}return i};return t.$$set=t=>{"schema"in t&&n(0,d=t.schema),"record"in t&&n(1,u=t.record)},t.$$.update=()=>{4&t.$$.dirty&&n(3,r=m)},[d,u,m,r,a,s,h,async()=>{const t=await Request.getEvent(d.id);if(t.trigger?.startOn&&!t.trigger?.startOn?.some(t=>"Manual"===t.type)&&n(2,m=!0),o.role?.length&&d.authorization?.length){const t=d.authorization.some(t=>i?.find(e=>e===t.role&&"edit"===t.activity));n(2,m||=!t)}},t=>{"button"!==t.srcElement?.type&&"textarea"!==t.srcElement?.type&&13==t.which&&t.preventDefault()},f,async t=>{const e={};Array.from(document.querySelectorAll("form#"+h+" ."+h)).map(t=>{const n=t.id||t.name;if(n)if(n.includes(".")){const[r,o]=n.split("."),i=d.list.find(t=>t.name===r);e[n]=p(i.item,t)}else e[n]=p(d.items,t)}),await Request.saveTemplate(d.class,e),toasts.success("Die Vorgaben wurden gespeichert.",2e3),f()}]}class Template$1 extends SvelteComponent{constructor(t){super(),document_1$d.getElementById("svelte-1phofh5-style")||add_css$s(),init(this,t,instance$w,create_fragment$w,safe_not_equal,{schema:0,record:1})}}const{document:document_1$c}=globals;function add_css$r(){var t=element("style");t.id="svelte-148ktt9-style",t.textContent=".accordion.svelte-148ktt9{display:flex}.formList .accordion > .btn{display:inline-block;width:97%;margin-bottom:1em;background-color:#F5F5F5}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}",append(document_1$c.head,t)}function get_each_context$a(t,e,n){const r=t.slice();return r[28]=e[n],r}function create_if_block$r(t){let e,n;return e=new InputFormField({props:{classId:t[2],item:t[28],listName:t[1].name,eventId:t[3],record:t[0],disabled:t[4],required:t[5],currency:t[8]}}),e.$on("notify",t[14]),e.$on("defPrep",t[16]),e.$on("task",t[21]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4&n[0]&&(r.classId=t[2]),2&n[0]&&(r.item=t[28]),2&n[0]&&(r.listName=t[1].name),8&n[0]&&(r.eventId=t[3]),1&n[0]&&(r.record=t[0]),16&n[0]&&(r.disabled=t[4]),32&n[0]&&(r.required=t[5]),256&n[0]&&(r.currency=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block$a(t){let e,n,r=checkType(t[7],t[28]),o=r&&create_if_block$r(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){130&n[0]&&(r=checkType(t[7],t[28])),r?o?(o.p(t,n),130&n[0]&&transition_in(o,1)):(o=create_if_block$r(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_default_slot_2$5(t){let e,n,r,o=t[1].item,i=[];for(let e=0;e<o.length;e+=1)i[e]=create_each_block$a(get_each_context$a(t,o,e));const a=t=>transition_out(i[t],1,1,()=>{i[t]=null});return{c(){e=element("div");for(let t=0;t<i.length;t+=1)i[t].c();attr(e,"id",n=`accordion-content-${t[2]}-${t[1].name}`)},m(t,n){insert(t,e,n);for(let t=0;t<i.length;t+=1)i[t].m(e,null);r=!0},p(t,s){if(82367&s[0]){let n;for(o=t[1].item,n=0;n<o.length;n+=1){const r=get_each_context$a(t,o,n);i[n]?(i[n].p(r,s),transition_in(i[n],1)):(i[n]=create_each_block$a(r),i[n].c(),transition_in(i[n],1),i[n].m(e,null))}for(group_outros(),n=o.length;n<i.length;n+=1)a(n);check_outros()}(!r||6&s[0]&&n!==(n=`accordion-content-${t[2]}-${t[1].name}`))&&attr(e,"id",n)},i(t){if(!r){for(let t=0;t<o.length;t+=1)transition_in(i[t]);r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)transition_out(i[t]);r=!1},d(t){t&&detach(e),destroy_each(i,t)}}}function create_default_slot_1$8(t){let e,n,r=t[13](t[9])+"";return{c(){e=element("span"),n=text(r)},m(t,r){insert(t,e,r),append(e,n)},p(t,e){512&e[0]&&r!==(r=t[13](t[9])+"")&&set_data(n,r)},d(t){t&&detach(e)}}}function create_handle_slot$1(t){let e,n,r;return n=new t[10]({props:{$$slots:{default:[create_default_slot_1$8]},$$scope:{ctx:t}}}),n.$on("click",function(){is_function(t[15](t[27]))&&t[15](t[27]).apply(this,arguments)}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"class","accordion svelte-148ktt9"),attr(e,"slot","handle")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(e,r){t=e;const o={};512&r[0]|1&r[1]&&(o.$$scope={dirty:r,ctx:t}),n.$set(o)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot$d(t){let e,n;return e=new t[12]({props:{open:t[6],$$slots:{handle:[create_handle_slot$1,({toggle:t})=>({27:t}),({toggle:t})=>[t?134217728:0]],default:[create_default_slot_2$5,({toggle:t})=>({27:t}),({toggle:t})=>[t?134217728:0]]},$$scope:{ctx:t}}}),e.$on("panel-open",t[17]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};64&n[0]&&(r.open=t[6]),134218687&n[0]|1&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$v(t){let e,n,r;return n=new t[11]({props:{$$slots:{default:[create_default_slot$d]},$$scope:{ctx:t}}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"class","formList")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(t,e){const r={};1023&e[0]|1&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function instance$v(t,e,n){const{Button:r,Accordion:o,AccordionSection:i}=getAttractions;let{list:a}=e,{schema:s}=e,{record:c}=e,{classId:l}=e,{eventId:d}=e,{disabled:u}=e,{required:h}=e,{open:m=!1}=e,{template:f={}}=e,{isTemplate:p=!1}=e,{currency:_}=e,{update:g=!1}=e,w=new Map;const $={};let y=c[a.name]||{};c[a.name]=y;const b=t=>$[t]?.split(" • ").filter(t=>!!t).slice(0,2).join(" · "),v=t=>{if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n}px`)};return t.$$set=t=>{"list"in t&&n(1,a=t.list),"schema"in t&&n(18,s=t.schema),"record"in t&&n(0,c=t.record),"classId"in t&&n(2,l=t.classId),"eventId"in t&&n(3,d=t.eventId),"disabled"in t&&n(4,u=t.disabled),"required"in t&&n(5,h=t.required),"open"in t&&n(6,m=t.open),"template"in t&&n(19,f=t.template),"isTemplate"in t&&n(7,p=t.isTemplate),"currency"in t&&n(8,_=t.currency),"update"in t&&n(20,g=t.update)},t.$$.update=()=>{1048579&t.$$.dirty[0]&&g&&c&&n(9,y=c[a.name]||{})},[c,a,l,d,u,h,m,p,_,y,r,o,i,t=>s.filter(e=>void 0!==t[e.name]&&"textarea"!==e.properties?.format&&"html"!==e.properties?.format).map(e=>"object"===e.type?b(e.name):"boolean"===e.type?checkBoolean(t[e.name]):"date"===e.type?checkDate(t[e.name]):"datetime"===e.type?checkDateTime(t[e.name]):t[e.name]).filter(t=>!!t).join(" • ")||"+",({detail:t})=>{const[e,r]=t.itemName.split(".");if(!r)return;t.desc&&($[r]=t.desc);const o=c[e];n(0,c[e]={...o,[r]:t.value},c),n(9,y=c[e])},t=>e=>{(()=>{const t=f[a.name]||{};for(const e in t)f[a.name][e]&&!c[a.name][e]&&n(0,c[a.name][e]=f[a.name][e],c)})(),t(e);const r=`#accordion-content-${l}-${a.name} > div.form-field:last-child`,o=document.querySelector(r);tick().then(()=>{const t=`#accordion-content-${l}-${a.name} textarea`;Array.from(document.querySelectorAll(t)).forEach(v)}).then(()=>o.scrollIntoView({behavior:"smooth",block:"end"}))},async({detail:{className:t,itemName:e,value:n}})=>{if(w.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===className+"."+a.name)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&w.set(t,o[0])},()=>{setTimeout(()=>{Array.from(w).forEach(([t,e])=>{c[a.name][t]||n(0,c[a.name][t]=e._id,c)})},500)},s,f,g,function(e){bubble(t,e)}]}class InputObject extends SvelteComponent{constructor(t){super(),document_1$c.getElementById("svelte-148ktt9-style")||add_css$r(),init(this,t,instance$v,create_fragment$v,safe_not_equal,{list:1,schema:18,record:0,classId:2,eventId:3,disabled:4,required:5,open:6,template:19,isTemplate:7,currency:8,update:20},[-1,-1])}}const{document:document_1$b}=globals;function add_css$q(){var t=element("style");t.id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",append(document_1$b.head,t)}function get_then_context$2(t){t[0]=t[23].list,t[22]=t[23].items}function get_each_context$9(t,e,n){const r=t.slice();return r[24]=e[n],r}function get_each_context_1$6(t,e,n){const r=t.slice();return r[27]=e[n],r}function get_each_context_2$4(t,e,n){const r=t.slice();return r[27]=e[n],r}function create_catch_block$7(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$7(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w;function $(e){t[19](e)}get_then_context$2(t),n=new t[7]({props:{outline:!0,$$slots:{default:[create_default_slot_1$7]},$$scope:{ctx:t}}}),n.$on("click",t[18]);let y={id:t[8]};void 0!==t[1]&&(y.value=t[1]),a=new t[6]({props:y}),binding_callbacks.push(()=>bind(a,"value",$)),a.$on("input",t[12]),d=new DeleteIcon({props:{size:"18"}});let b=t[22]?.length&&create_if_block_2$9(t),v=t[0]?.length&&create_if_block$q(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),o=element("div"),i=text("Suchen: "),create_component(a.$$.fragment),c=space(),l=element("span"),create_component(d.$$.fragment),u=space(),h=element("div"),m=element("table"),b&&b.c(),f=space(),p=element("tbody"),v&&v.c(),attr(e,"class","form--buttons svelte-14hcfjl"),attr(l,"class","feather pointer svelte-14hcfjl"),set_style(o,"margin-bottom","1em"),set_style(o,"position","relative"),attr(m,"striped",""),attr(m,"class","svelte-14hcfjl"),attr(h,"class","eList svelte-14hcfjl")},m(s,$){insert(s,e,$),mount_component(n,e,null),insert(s,r,$),insert(s,o,$),append(o,i),mount_component(a,o,null),append(o,c),append(o,l),mount_component(d,l,null),insert(s,u,$),insert(s,h,$),append(h,m),b&&b.m(m,null),append(m,f),append(m,p),v&&v.m(p,null),_=!0,g||(w=listen(l,"click",t[14]),g=!0)},p(t,e){get_then_context$2(t);const r={};2&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const o={};!s&&2&e[0]&&(s=!0,o.value=t[1],add_flush_callback(()=>s=!1)),a.$set(o),t[22]?.length&&b.p(t,e),t[0]?.length&&v.p(t,e)},i(t){_||(transition_in(n.$$.fragment,t),transition_in(a.$$.fragment,t),transition_in(d.$$.fragment,t),_=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a.$$.fragment,t),transition_out(d.$$.fragment,t),_=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),t&&detach(o),destroy_component(a),destroy_component(d),t&&detach(u),t&&detach(h),b&&b.d(),v&&v.d(),g=!1,w()}}}function create_default_slot_1$7(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_2$9(t){let e,n,r=t[22],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_2$4(get_each_context_2$4(t,r,e));return{c(){e=element("thead"),n=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();attr(n,"class","svelte-14hcfjl"),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n);for(let t=0;t<o.length;t+=1)o[t].m(n,null)},p(t,e){if(2048&e[0]){let i;for(r=t[22],i=0;i<r.length;i+=1){const a=get_each_context_2$4(t,r,i);o[i]?o[i].p(a,e):(o[i]=create_each_block_2$4(a),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=r.length}},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_2$4(t){let e,n,r=t[27]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$q(t){let e,n=t[0],r=[];for(let e=0;e<n.length;e+=1)r[e]=create_each_block$9(get_each_context$9(t,n,e));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,n){for(let e=0;e<r.length;e+=1)r[e].m(t,n);insert(t,e,n)},p(t,o){if(11778&o[0]){let i;for(n=t[0],i=0;i<n.length;i+=1){const a=get_each_context$9(t,n,i);r[i]?r[i].p(a,o):(r[i]=create_each_block$9(a),r[i].c(),r[i].m(e.parentNode,e))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){destroy_each(r,t),t&&detach(e)}}}function create_if_block_1$f(t){let e,n,r=t[22],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_1$6(get_each_context_1$6(t,r,e));return{c(){e=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();n=space(),attr(e,"class","pointer svelte-14hcfjl")},m(t,r){insert(t,e,r);for(let t=0;t<o.length;t+=1)o[t].m(e,null);append(e,n)},p(t,i){if(3584&i[0]){let a;for(r=t[22],a=0;a<r.length;a+=1){const s=get_each_context_1$6(t,r,a);o[a]?o[a].p(s,i):(o[a]=create_each_block_1$6(s),o[a].c(),o[a].m(e,n))}for(;a<o.length;a+=1)o[a].d(1);o.length=r.length}},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_1$6(t){let e,n,r,o,i=t[9](t[24],t[27])+"";return{c(){e=element("td"),n=text(i),attr(e,"class","svelte-14hcfjl")},m(i,a){insert(i,e,a),append(e,n),r||(o=listen(e,"click",stop_propagation(t[10](t[24]))),r=!0)},p(e,n){t=e},d(t){t&&detach(e),r=!1,o()}}}function create_each_block$9(t){let e,n=t[13](t[24],t[22],t[1]),r=n&&create_if_block_1$f(t);return{c(){r&&r.c(),e=empty()},m(t,n){r&&r.m(t,n),insert(t,e,n)},p(t,o){2&o[0]&&(n=t[13](t[24],t[22],t[1])),n?r?r.p(t,o):(r=create_if_block_1$f(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){r&&r.d(t),t&&detach(e)}}}function create_pending_block$7(t){let e,n;return e=new t[5]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$c(t){let e,n,r,o;e=new t[4]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$7,then:create_then_block$7,catch:create_catch_block$7,value:23,blocks:[,,,]};return handle_promise(t[11](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$u(t){let e,n;return e=new t[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[create_default_slot$c]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2&n[0]|2&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$u(t,e,n){const r=createEventDispatcher(),{Dialog:o,Divider:i,Loading:a,TextField:s,Button:c}=getAttractions;let{item:l}=e,{className:d}=e,{classId:u}=e,{list:h}=e,m="",f=u+Math.floor(9e3*Math.random()+1e3).toString()+"search";const p=(t,e)=>{if(!e)return;const n=t[e.name];return"boolean"==typeof n?checkBoolean(n):checkDate(t[`_${e.name}`]||t[e.name]||"")},_=Request.getSchemaByClass(d);onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(f)?.focus()},200)});return t.$$set=t=>{"item"in t&&n(15,l=t.item),"className"in t&&n(16,d=t.className),"classId"in t&&n(17,u=t.classId),"list"in t&&n(0,h=t.list)},[h,m,r,o,i,a,s,c,f,p,t=>()=>r("choose",{row:t}),async()=>{const t=await _,e=t.display;let n=await getDisplayItems(e,t,h);return{list:h,items:n}},({detail:{value:t}})=>{n(1,m=t)},(t,e,n)=>{if(!n)return!0;for(const r of e)if(p(t,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{n(1,m="")},l,d,u,()=>r("back"),function(t){m=t,n(1,m)}]}class ViewList3 extends SvelteComponent{constructor(t){super(),document_1$b.getElementById("svelte-14hcfjl-style")||add_css$q(),init(this,t,instance$u,create_fragment$u,safe_not_equal,{item:15,className:16,classId:17,list:0},[-1,-1])}}const{document:document_1$a}=globals;function add_css$p(){var t=element("style");t.id="svelte-16mo2c-style",t.textContent=".feather2.svelte-16mo2c{position:absolute;top:1em;right:0.5em;color:#4300b0}",append(document_1$a.head,t)}function get_each_context$8(t,e,n){const r=t.slice();return r[11]=e[n],r}function get_each_context_1$5(t,e,n){const r=t.slice();return r[3]=e[n],r}function create_catch_block$6(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$6(t){let e,n,r,o=t[7].items,i=[];for(let e=0;e<o.length;e+=1)i[e]=create_each_block_1$5(get_each_context_1$5(t,o,e));const a=t=>transition_out(i[t],1,1,()=>{i[t]=null});let s=t[7].list&&create_if_block_1$e(t);return{c(){for(let t=0;t<i.length;t+=1)i[t].c();e=space(),s&&s.c(),n=empty()},m(t,o){for(let e=0;e<i.length;e+=1)i[e].m(t,o);insert(t,e,o),s&&s.m(t,o),insert(t,n,o),r=!0},p(t,r){if(30327783&r[0]){let n;for(o=t[7].items,n=0;n<o.length;n+=1){const a=get_each_context_1$5(t,o,n);i[n]?(i[n].p(a,r),transition_in(i[n],1)):(i[n]=create_each_block_1$5(a),i[n].c(),transition_in(i[n],1),i[n].m(e.parentNode,e))}for(group_outros(),n=o.length;n<i.length;n+=1)a(n);check_outros()}t[7].list?s?(s.p(t,r),128&r[0]&&transition_in(s,1)):(s=create_if_block_1$e(t),s.c(),transition_in(s,1),s.m(n.parentNode,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros())},i(t){if(!r){for(let t=0;t<o.length;t+=1)transition_in(i[t]);transition_in(s),r=!0}},o(t){i=i.filter(Boolean);for(let t=0;t<i.length;t+=1)transition_out(i[t]);transition_out(s),r=!1},d(t){destroy_each(i,t),t&&detach(e),s&&s.d(t),t&&detach(n)}}}function create_if_block_3$5(t){let e,n,r,o;const i=[create_if_block_4$5,create_if_block_6$3],a=[];function s(t,e){return t[3].name!==t[14]||t[15]?"lookup"!==t[3].properties?.format?1:-1:0}return~(e=s(t))&&(n=a[e]=i[e](t)),{c(){n&&n.c(),r=empty()},m(t,n){~e&&a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?~e&&a[e].p(t,o):(n&&(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros()),~e?(n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r)):n=null)},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){~e&&a[e].d(t),t&&detach(r)}}}function create_if_block_6$3(t){let e,n;return e=new InputFormField({props:{classId:t[8],item:t[3],record:t[6],disabled:t[3].name===t[14]&&t[15]||t[0],eventId:t[5],currency:t[2],changeValue:t[9]}}),e.$on("notify",t[17]),e.$on("multi",t[18]),e.$on("defPrep",t[19]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};256&n[0]&&(r.classId=t[8]),128&n[0]&&(r.item=t[3]),64&n[0]&&(r.record=t[6]),129&n[0]&&(r.disabled=t[3].name===t[14]&&t[15]||t[0]),32&n[0]&&(r.eventId=t[5]),4&n[0]&&(r.currency=t[2]),512&n[0]&&(r.changeValue=t[9]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_4$5(t){let e,n,r,o;n=new InputFormField({props:{classId:t[8],item:t[3],record:t[6],disabled:t[0]||!!t[1],required:!0,eventId:t[5],currency:t[2],changeValue:t[9]}}),n.$on("notify",t[17]),n.$on("multi",t[18]),n.$on("defPrep",t[19]),n.$on("record",t[23]),n.$on("objRecord",t[24]);let i=t[1]&&create_if_block_5$5(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i&&i.c(),set_style(e,"padding-top",".25em"),set_style(e,"background-color","lightyellow"),set_style(e,"position","relative")},m(t,a){insert(t,e,a),mount_component(n,e,null),append(e,r),i&&i.m(e,null),o=!0},p(t,r){const o={};256&r[0]&&(o.classId=t[8]),128&r[0]&&(o.item=t[3]),64&r[0]&&(o.record=t[6]),3&r[0]&&(o.disabled=t[0]||!!t[1]),32&r[0]&&(o.eventId=t[5]),4&r[0]&&(o.currency=t[2]),512&r[0]&&(o.changeValue=t[9]),n.$set(o),t[1]?i?(i.p(t,r),2&r[0]&&transition_in(i,1)):(i=create_if_block_5$5(t),i.c(),transition_in(i,1),i.m(e,null)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){o||(transition_in(n.$$.fragment,t),transition_in(i),o=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),o=!1},d(t){t&&detach(e),destroy_component(n),i&&i.d()}}}function create_if_block_5$5(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 pointer svelte-16mo2c")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[22]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block_1$5(t){let e,n,r="list"!==t[3].type&&create_if_block_3$5(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){"list"!==t[3].type?r?(r.p(t,n),128&n[0]&&transition_in(r,1)):(r=create_if_block_3$5(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_1$e(t){let e,n,r=t[7].list,o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$8(get_each_context$8(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(485&n[0]){let a;for(r=t[7].list,a=0;a<r.length;a+=1){const i=get_each_context$8(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$8(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block_2$8(t){let e,n,r,o;return e=new t[12]({props:{text:t[11].designation}}),r=new InputObject({props:{classId:t[8],list:t[11],eventId:t[5],schema:t[11].item,record:t[6],disabled:t[0],currency:t[2],update:!0}}),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};128&n[0]&&(o.text=t[11].designation),e.$set(o);const i={};256&n[0]&&(i.classId=t[8]),128&n[0]&&(i.list=t[11]),32&n[0]&&(i.eventId=t[5]),128&n[0]&&(i.schema=t[11].item),64&n[0]&&(i.record=t[6]),1&n[0]&&(i.disabled=t[0]),4&n[0]&&(i.currency=t[2]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_each_block$8(t){let e,n,r="array"!==t[11].type&&create_if_block_2$8(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){"array"!==t[11].type?r?(r.p(t,n),128&n[0]&&transition_in(r,1)):(r=create_if_block_2$8(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_pending_block$6(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_if_block$p(t){let e,n;return e=new ViewList3({props:{item:t[3],className:t[4],classId:t[8],list:t[11]}}),e.$on("choose",t[20]),e.$on("back",t[21]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8&n[0]&&(r.item=t[3]),16&n[0]&&(r.className=t[4]),256&n[0]&&(r.classId=t[8]),2048&n[0]&&(r.list=t[11]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$b(t){let e,n,r=t[10]&&create_if_block$p(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[10]?r?(r.p(t,n),1024&n[0]&&transition_in(r,1)):(r=create_if_block$p(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_fragment$t(t){let e,n,r,o,i,a,s={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$6,then:create_then_block$6,catch:create_catch_block$6,value:54,blocks:[,,,]};function c(e){t[30](e)}handle_promise(t[16](),s),n=new t[12]({});let l={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$b]},$$scope:{ctx:t}};return void 0!==t[10]&&(l.open=t[10]),o=new t[13]({props:l}),binding_callbacks.push(()=>bind(o,"open",c)),{c(){s.block.c(),e=space(),create_component(n.$$.fragment),r=space(),create_component(o.$$.fragment)},m(t,i){s.block.m(t,s.anchor=i),s.mount=()=>e.parentNode,s.anchor=e,insert(t,e,i),mount_component(n,t,i),insert(t,r,i),mount_component(o,t,i),a=!0},p(e,n){update_await_block_branch(s,t=e,n);const r={};3352&n[0]|268435456&n[1]&&(r.$$scope={dirty:n,ctx:t}),!i&&1024&n[0]&&(i=!0,r.open=t[10],add_flush_callback(()=>i=!1)),o.$set(r)},i(t){a||(transition_in(s.block),transition_in(n.$$.fragment,t),transition_in(o.$$.fragment,t),a=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(s.blocks[t])}transition_out(n.$$.fragment,t),transition_out(o.$$.fragment,t),a=!1},d(t){s.block.d(t),s.token=null,s=null,t&&detach(e),destroy_component(n,t),t&&detach(r),destroy_component(o,t)}}}function instance$t(t,e,n){const{Divider:r,FormField:o,Modal:i}=getAttractions,a=createEventDispatcher();let s,c,l,d,u,{required:h}=e,{disabled:m}=e,{readonly:f}=e,{id:p}=e,{item:_}=e,{value:g}=e,{refValue:w}=e,{currency:$}=e,y={},b=[],v=[],I={},C=new Map,E=!1,A="";const S=_.checkOn,k=g,T=t=>{s.items.filter(e=>"object"==typeof(e.properties&&e.properties[t])).map(e=>{const n=e.properties[t].refItem||"",[r,o]=n.split(".");b.push({action:t,itemName:e.name,refObj:r,refName:o,op:e.properties[t].invert?"!":""})})},R=()=>{s.items.filter(t=>t.lookup).forEach(t=>{v.push({name:t.name,lookup:t.lookup})}),s.items.filter(t=>t.properties?.lookup).forEach(t=>{v.push({name:t.name,lookup:t.properties.lookup.split(":").at(-1)})})},N=async t=>{const e=b.filter(e=>e.refObj===t);if(e?.length){n(9,I={});for(const t of e){const{itemName:e,refObj:r,refName:o,op:i}=t;let{action:a}=t;if(!r)break;let s,l,d=!o&&y[r];const u=y[r];u&&o&&(d=(await getTaskFull(r,u))[o]),Array.isArray(d)&&0===d.length&&(d=!1),"!"===i&&(d=!d),"required"!==a&&"readonly"!==a||(a="required"===a?a:"disabled",setTimeout(()=>{s=`#${c} .form-field.${e} .field textarea`,l=document.querySelector(s),l||(s=`#${c} .form-field.${e} .field input`,l=document.querySelector(s)),l&&d&&l.setAttribute(a,""),l&&!d&&l.removeAttribute(a)},0)),"hidden"===a&&(s=`#${c} .form-field.${e}`,l=document.querySelector(s),l?.classList?.toggle("hidden",!!d),d&&n(9,I[e]="",I))}}};onMount(()=>{D()});const D=async()=>{const t=t=>new Promise(e=>setTimeout(e,t));let e,n=0;for(;!(e=document.getElementById(c))&&++n<20;)await t(50);e&&((()=>{if(recID)return;const t=new Set;for(const e of b)t.add(e.refObj||l);Array.from(t).forEach(t=>N(t))})(),x())},x=()=>{setTimeout(()=>{Array.from(C).forEach(([t,e])=>{y[t]||n(6,y[t]=e._id,y)})},250)},O=async t=>{if(!t.value)return void P();const e={[t.itemName]:{$regex:`(?i)${t.value}`}},r=await Request.getSectionView(l,e);r?.length?(n(11,A=r),n(10,E=!0)):(n(1,g=""),n(25,w=""),a("setRefValue",w))},M=()=>{n(10,E=!1)},P=()=>{n(1,g=""),n(25,w=g),n(6,y={}),a("setRefValue",w)};return t.$$set=t=>{"required"in t&&n(26,h=t.required),"disabled"in t&&n(0,m=t.disabled),"readonly"in t&&n(27,f=t.readonly),"id"in t&&n(28,p=t.id),"item"in t&&n(3,_=t.item),"value"in t&&n(1,g=t.value),"refValue"in t&&n(25,w=t.refValue),"currency"in t&&n(2,$=t.currency)},t.$$.update=()=>{134217729&t.$$.dirty[0]&&n(0,m=m||f),536871024&t.$$.dirty[0]&&y&&a("safeReference",{record:y,class:l,event:d,taskId:u})},[m,g,$,_,l,d,y,s,c,I,E,A,r,i,S,k,async()=>{try{if(g){const t=await Request.getTask(_.refClass,g);delete t._task,n(6,y=t),n(29,u=(await Request.getTaskByDocId(t._id,!0))._id)}else n(6,y={})}catch{}return n(7,s=await Request.getSchemaByClass(_.refClass)),n(8,c="form-"+s.class+Math.floor(9e3*Math.random()+1e3).toString()),n(4,l=s.class),s.identity.designation,n(5,d=s.id),["readonly","hidden","required"].map(T),R(),!0},async({detail:t})=>{const{itemName:e,value:r}=t;if(n(6,y[e]=r,y),e===S)return O(t);N(e)},async({detail:t})=>{if(!(s.input?.length&&s.input.length>1))return;if(prevSchema?.class!==s.input[0])return;const{value:e,lookup:r,view:o}=t,[i]=r.split(":"),a=(await Request.getSectionView(i,{[o]:{$in:e}})).map(t=>t._id);for(const t of s.input.slice(1)){n(6,y[t]=[],y);const e=await Request.getSchemaByClass(t);e.id;let r=await Request.getTasks(e.id);if(r=r.data.filter(t=>"Ready"===t._task?.status&&a.includes(t[i])),r?.length){const e=r.map(t=>t._id),o=await Request.getSectionView(t,{_id:{$in:e}});for(const e of o)e[t]=e._id;n(6,y[t]=o,y)}}},async({detail:{className:t,itemName:e,value:n}})=>{if(C.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===l)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&C.set(t,o[0])},async({detail:t})=>{const e=await Request.getSectionView(l,{_id:t.row._id});e?.length&&(n(1,g=e[0]._id),n(25,w=g),a("setRefValue",w),n(6,y=e[0])),M()},M,P,({detail:t})=>{n(6,y[t.itemName]=t.value,y)},({detail:t})=>{for(const e of t.items)n(6,y[t.listName][e.name]=e.value,y)},w,h,f,p,u,function(t){E=t,n(10,E)}]}class InputObjectReference extends SvelteComponent{constructor(t){super(),document_1$a.getElementById("svelte-16mo2c-style")||add_css$p(),init(this,t,instance$t,create_fragment$t,safe_not_equal,{required:26,disabled:0,readonly:27,id:28,item:3,value:1,refValue:25,currency:2},[-1,-1])}}function add_css$o(){var t=element("style");t.id="svelte-1fuww0c-style",t.textContent=".feather.svelte-1fuww0c{position:absolute;top:0.75em;right:-1em;color:#4300b0}",append(document.head,t)}function create_if_block_1$d(t){let e,n;return{c(){e=element("span"),n=text(t[4]),attr(e,"class","item")},m(t,r){insert(t,e,r),append(e,n)},p(t,e){16&e[0]&&set_data(n,t[4])},d(t){t&&detach(e)}}}function create_if_block$o(t){let e,n,r,o,i;return n=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Übernehmen"),attr(e,"class","pointer feather svelte-1fuww0c")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[17]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_default_slot$a(t){let e,n,r,o=t[6]&&create_if_block_1$d(t),i=t[14]&&create_if_block$o(t);return{c(){o&&o.c(),e=space(),i&&i.c(),n=empty()},m(t,a){o&&o.m(t,a),insert(t,e,a),i&&i.m(t,a),insert(t,n,a),r=!0},p(t,n){t[6]?o?o.p(t,n):(o=create_if_block_1$d(t),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),t[14]&&i.p(t,n)},i(t){r||(transition_in(i),r=!0)},o(t){transition_out(i),r=!1},d(t){o&&o.d(t),t&&detach(e),i&&i.d(t),t&&detach(n)}}}function create_fragment$s(t){let e,n,r;return n=new t[10]({props:{withItem:!0,itemLeft:!0,lang:t[11].id,class:"left",type:"string",inputClass:"txt-right"+(t[1]?"":" "+t[2]),id:t[0],name:t[0],value:t[9],step:t[12],pattern:t[7],placeholder:t[13],readonly:t[8],disabled:t[3],required:t[5],$$slots:{default:[create_default_slot$a]},$$scope:{ctx:t}}}),n.$on("change",t[15]),n.$on("focus",t[16]),{c(){e=element("div"),create_component(n.$$.fragment),set_style(e,"position","relative"),set_style(e,"max-width","10em")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(t,e){const r={};6&e[0]&&(r.inputClass="txt-right"+(t[1]?"":" "+t[2])),1&e[0]&&(r.id=t[0]),1&e[0]&&(r.name=t[0]),512&e[0]&&(r.value=t[9]),128&e[0]&&(r.pattern=t[7]),256&e[0]&&(r.readonly=t[8]),8&e[0]&&(r.disabled=t[3]),32&e[0]&&(r.required=t[5]),80&e[0]|32&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function instance$s(t,e,n){const r=createEventDispatcher(),{TextField:o}=getAttractions;let{id:i}=e,{item:a}=e,{value:s}=e,{noForm:c=!1}=e,{classId:l}=e,{disabled:d}=e,{formnovalidate:u}=e,{currency:h}=e,{praefix:m}=e,{notifyList:f}=e;const p=JSON.parse(Storage.getItem("Locale"));let _=["price","amount","amountValue","taxValue","total","__total"].find(t=>t===a.name?.split("-")[0])||a.properties?.currency;!1===a.properties?.currency&&(_=!1);const g=Number("1.1").toLocaleString(p.id).substring(1,2),{properties:w={}}=a;let{min:$,max:y,step:b,pattern:v,decimals:I=0,unit:C="",placeholder:E,hint:A,readonly:S,negative:k,required:T=!1,transfer:R}=w,N="";s=s?Number(s.toString().replace(",",".")):0,S=!0===S||void 0;const D=t=>Number(t.toString()).toFixed(I).toString().replace(".",g);v||(v=I?`[0-9]+([${g}][0-9]{1,${I}})?`:"[0-9]*"),k&&(v="-?"+v);return t.$$set=t=>{"id"in t&&n(0,i=t.id),"item"in t&&n(19,a=t.item),"value"in t&&n(18,s=t.value),"noForm"in t&&n(1,c=t.noForm),"classId"in t&&n(2,l=t.classId),"disabled"in t&&n(3,d=t.disabled),"formnovalidate"in t&&n(20,u=t.formnovalidate),"currency"in t&&n(4,h=t.currency),"praefix"in t&&n(21,m=t.praefix),"notifyList"in t&&n(22,f=t.notifyList)},t.$$.update=()=>{1048608&t.$$.dirty[0]&&n(5,T=T&&!u),262144&t.$$.dirty[0]&&(t=>{n(9,N=D(t.toString().replace(",",".")))})(s),4194304&t.$$.dirty[0]&&(async()=>{const t=a.properties?.value?.formula;if(t)void 0!==m&&""!==m?t?.operator?.multiply&&r("formula",{item:a}):t?.operator&&r("formula",{item:a})})()},[i,c,l,d,h,T,_,v,S,N,o,p,b,E,R,({detail:t})=>r("blur",{value:D(t.value)}),({detail:t})=>{S||+s||n(9,N="")},({detail:t})=>{const e=[].concat(R.target);for(const t of e)r("record",{itemName:t,value:s}),r("listRecord",{itemName:t,decimals:a.properties?.decimals,value:s})},s,a,u,m,f]}class InputNumber extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-1fuww0c-style")||add_css$o(),init(this,t,instance$s,create_fragment$s,safe_not_equal,{id:0,item:19,value:18,noForm:1,classId:2,disabled:3,formnovalidate:20,currency:4,praefix:21,notifyList:22},[-1,-1])}}const{document:document_1$9}=globals;function add_css$n(){var t=element("style");t.id="svelte-1m010ne-style",t.textContent=".feather.svelte-1m010ne.svelte-1m010ne{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-1m010ne.svelte-1m010ne{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-1m010ne table.svelte-1m010ne{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-1m010ne table thead.svelte-1m010ne{position:sticky;top:0;background:#326173;color:white}.eList.svelte-1m010ne table tbody tr.svelte-1m010ne{height:2.3em}th.svelte-1m010ne.svelte-1m010ne,td.svelte-1m010ne.svelte-1m010ne{padding-left:0.4em;padding-right:0.4em}tr.active.svelte-1m010ne.svelte-1m010ne{color:#326173;background-color:#fcebd5}.dialog.eList{max-height:90vh}.checkbox.round > .selector{border-color:#326173 !important}.form--buttons.svelte-1m010ne.svelte-1m010ne{display:flex;gap:1em;padding:0.5em 0}",append(document_1$9.head,t)}function get_then_context$1(t){t[34]=t[36].list,t[35]=t[36].items}function get_each_context$7(t,e,n){const r=t.slice();return r[37]=e[n],r[39]=n,r}function get_each_context_1$4(t,e,n){const r=t.slice();return r[40]=e[n],r[42]=n,r}function get_each_context_2$3(t,e,n){const r=t.slice();return r[40]=e[n],r}function create_catch_block$5(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$5(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$;get_then_context$1(t),n=new t[9]({props:{outline:!0,$$slots:{default:[create_default_slot_2$4]},$$scope:{ctx:t}}}),n.$on("click",t[31]);let y=!t[2]&&create_if_block_5$4(t);function b(e){t[32](e)}let v={id:t[12]};void 0!==t[3]&&(v.value=t[3]),s=new t[7]({props:v}),binding_callbacks.push(()=>bind(s,"value",b)),s.$on("input",t[15]),u=new DeleteIcon({props:{size:"18"}});let I=t[35]?.length&&create_if_block_3$4(t),C=t[34]?.length&&create_if_block$n(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),y&&y.c(),o=space(),i=element("div"),a=text("Suchen: "),create_component(s.$$.fragment),l=space(),d=element("span"),create_component(u.$$.fragment),h=space(),m=element("div"),f=element("table"),I&&I.c(),p=space(),_=element("tbody"),C&&C.c(),attr(e,"class","form--buttons svelte-1m010ne"),attr(d,"class","feather pointer svelte-1m010ne"),set_style(i,"margin-bottom","1em"),set_style(i,"position","relative"),attr(f,"striped",""),attr(f,"class","svelte-1m010ne"),attr(m,"class","eList svelte-1m010ne")},m(c,b){insert(c,e,b),mount_component(n,e,null),append(e,r),y&&y.m(e,null),insert(c,o,b),insert(c,i,b),append(i,a),mount_component(s,i,null),append(i,l),append(i,d),mount_component(u,d,null),insert(c,h,b),insert(c,m,b),append(m,f),I&&I.m(f,null),append(f,p),append(f,_),C&&C.m(_,null),g=!0,w||($=listen(d,"click",t[17]),w=!0)},p(t,r){get_then_context$1(t);const o={};16384&r[1]&&(o.$$scope={dirty:r,ctx:t}),n.$set(o),t[2]?y&&(group_outros(),transition_out(y,1,1,()=>{y=null}),check_outros()):y?(y.p(t,r),4&r[0]&&transition_in(y,1)):(y=create_if_block_5$4(t),y.c(),transition_in(y,1),y.m(e,null));const i={};!c&&8&r[0]&&(c=!0,i.value=t[3],add_flush_callback(()=>c=!1)),s.$set(i),t[35]?.length&&I.p(t,r),t[34]?.length&&C.p(t,r)},i(t){g||(transition_in(n.$$.fragment,t),transition_in(y),transition_in(s.$$.fragment,t),transition_in(u.$$.fragment,t),transition_in(I),transition_in(C),g=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(y),transition_out(s.$$.fragment,t),transition_out(u.$$.fragment,t),transition_out(I),transition_out(C),g=!1},d(t){t&&detach(e),destroy_component(n),y&&y.d(),t&&detach(o),t&&detach(i),destroy_component(s),destroy_component(u),t&&detach(h),t&&detach(m),I&&I.d(),C&&C.d(),w=!1,$()}}}function create_default_slot_2$4(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_5$4(t){let e,n;return e=new t[9]({props:{disabled:!t[34].length,filled:!0,$$slots:{default:[create_default_slot_1$6]},$$scope:{ctx:t}}}),e.$on("click",t[18](t[34])),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16384&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$6(t){let e;return{c(){e=text("Bestätigen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_3$4(t){let e,n,r,o,i=!t[2]&&create_if_block_4$4(t),a=t[35],s=[];for(let e=0;e<a.length;e+=1)s[e]=create_each_block_2$3(get_each_context_2$3(t,a,e));return{c(){e=element("thead"),n=element("tr"),i&&i.c(),r=space();for(let t=0;t<s.length;t+=1)s[t].c();attr(n,"class","svelte-1m010ne"),attr(e,"class","svelte-1m010ne")},m(t,a){insert(t,e,a),append(e,n),i&&i.m(n,null),append(n,r);for(let t=0;t<s.length;t+=1)s[t].m(n,null);o=!0},p(t,e){if(t[2]?i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros()):i?(i.p(t,e),4&e[0]&&transition_in(i,1)):(i=create_if_block_4$4(t),i.c(),transition_in(i,1),i.m(n,r)),16384&e[0]){let r;for(a=t[35],r=0;r<a.length;r+=1){const o=get_each_context_2$3(t,a,r);s[r]?s[r].p(o,e):(s[r]=create_each_block_2$3(o),s[r].c(),s[r].m(n,null))}for(;r<s.length;r+=1)s[r].d(1);s.length=a.length}},i(t){o||(transition_in(i),o=!0)},o(t){transition_out(i),o=!1},d(t){t&&detach(e),i&&i.d(),destroy_each(s,t)}}}function create_if_block_4$4(t){let e,n,r,o,i;return n=new CheckCircleIcon({props:{size:"20"}}),{c(){e=element("th"),create_component(n.$$.fragment),attr(e,"class","svelte-1m010ne")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[19](t[34])),o=!0)},p(e,n){t=e},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_each_block_2$3(t){let e,n,r=t[40]+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-1m010ne")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$n(t){let e,n,r=t[34],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block$7(get_each_context$7(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(1138717&n[0]){let a;for(r=t[34],a=0;a<r.length;a+=1){const i=get_each_context$7(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block$7(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block_1$c(t){let e,n,r,o,i,a,s,c=t[0],l=create_key_block$1(t),d=t[35],u=[];for(let e=0;e<d.length;e+=1)u[e]=create_each_block_1$4(get_each_context_1$4(t,d,e));return{c(){e=element("tr"),l.c(),n=space();for(let t=0;t<u.length;t+=1)u[t].c();r=space(),attr(e,"style",o=t[2]?"cursor: default;":"cursor: zoom-in;"),attr(e,"title","übernimmt den Wert direkt"),attr(e,"class","svelte-1m010ne"),toggle_class(e,"active",t[0].includes(Array.isArray(t[37])?t[37][0]:t[37]))},m(o,c){insert(o,e,c),l.m(e,null),append(e,n);for(let t=0;t<u.length;t+=1)u[t].m(e,null);append(e,r),i=!0,a||(s=listen(e,"click",t[20](t[37])),a=!0)},p(a,s){if(t=a,1&s[0]&&safe_not_equal(c,c=t[0])?(group_outros(),transition_out(l,1,1,noop),check_outros(),l=create_key_block$1(t),l.c(),transition_in(l),l.m(e,n)):l.p(t,s),16400&s[0]){let n;for(d=t[35],n=0;n<d.length;n+=1){const o=get_each_context_1$4(t,d,n);u[n]?u[n].p(o,s):(u[n]=create_each_block_1$4(o),u[n].c(),u[n].m(e,r))}for(;n<u.length;n+=1)u[n].d(1);u.length=d.length}(!i||4&s[0]&&o!==(o=t[2]?"cursor: default;":"cursor: zoom-in;"))&&attr(e,"style",o),16385&s[0]&&toggle_class(e,"active",t[0].includes(Array.isArray(t[37])?t[37][0]:t[37]))},i(t){i||(transition_in(l),i=!0)},o(t){transition_out(l),i=!1},d(t){t&&detach(e),l.d(t),destroy_each(u,t),a=!1,s()}}}function create_if_block_2$7(t){let e,n,r;return n=new t[11]({props:{name:t[13],data:t[39],checked:t[0].includes(Array.isArray(t[37])?t[37][0]:t[37]),round:!0}}),{c(){e=element("td"),create_component(n.$$.fragment),attr(e,"title","Wählt den Wert aus"),attr(e,"class","svelte-1m010ne")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p(t,e){const r={};1&e[0]&&(r.checked=t[0].includes(Array.isArray(t[37])?t[37][0]:t[37])),n.$set(r)},i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_key_block$1(t){let e,n,r=!t[2]&&create_if_block_2$7(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){t[2]?r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros()):r?(r.p(t,n),4&n[0]&&transition_in(r,1)):(r=create_if_block_2$7(t),r.c(),transition_in(r,1),r.m(e.parentNode,e))},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_each_block_1$4(t){let e,n,r=(Array.isArray(t[37])?t[37][t[42]]:t[4][t[39]]?t[4][t[39]][t[42]]:t[37])+"";return{c(){e=element("td"),n=text(r),attr(e,"class","svelte-1m010ne")},m(t,r){insert(t,e,r),append(e,n)},p(t,e){16&e[0]&&r!==(r=(Array.isArray(t[37])?t[37][t[42]]:t[4][t[39]]?t[4][t[39]][t[42]]:t[37])+"")&&set_data(n,r)},d(t){t&&detach(e)}}}function create_each_block$7(t){let e,n,r=t[16](t[37],t[3]),o=r&&create_if_block_1$c(t);return{c(){o&&o.c(),e=empty()},m(t,r){o&&o.m(t,r),insert(t,e,r),n=!0},p(t,n){8&n[0]&&(r=t[16](t[37],t[3])),r?o?(o.p(t,n),8&n[0]&&transition_in(o,1)):(o=create_if_block_1$c(t),o.c(),transition_in(o,1),o.m(e.parentNode,e)):o&&(group_outros(),transition_out(o,1,1,()=>{o=null}),check_outros())},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){o&&o.d(t),t&&detach(e)}}}function create_pending_block$5(t){let e,n;return e=new t[6]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$9(t){let e,n,r,o;e=new t[10]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$5,then:create_then_block$5,catch:create_catch_block$5,value:36,blocks:[,,,]};return handle_promise(t[14](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$r(t){let e,n;return e=new t[8]({props:{title:t[1]||"Auswahl",class:"eList",$$slots:{default:[create_default_slot$9]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2&n[0]&&(r.title=t[1]||"Auswahl"),29&n[0]|16384&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$r(t,e,n){const r=createEventDispatcher(),{Loading:o,TextField:i,Dialog:a,Button:s,Divider:c,Checkbox:l}=getAttractions;let{classId:d}=e,{id:u}=e,{designation:h}=e,{selection:m}=e,{refDoc:f}=e,{tableName:p}=e,{idName:_}=e,{target:g}=e,{view:w}=e,{unique:$}=e,{uniqueView:y}=e,{status:b}=e,{single:v}=e;m||=[];let I="",C=d+Math.floor(9e3*Math.random()+1e3).toString()+"search",E=[];const A=p+_+g+"checkbox",S=(t,e)=>t>e?1:e>t?-1:0;onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(C)?.focus()},200)});return t.$$set=t=>{"classId"in t&&n(22,d=t.classId),"id"in t&&n(23,u=t.id),"designation"in t&&n(1,h=t.designation),"selection"in t&&n(0,m=t.selection),"refDoc"in t&&n(24,f=t.refDoc),"tableName"in t&&n(25,p=t.tableName),"idName"in t&&n(26,_=t.idName),"target"in t&&n(21,g=t.target),"view"in t&&n(27,w=t.view),"unique"in t&&n(28,$=t.unique),"uniqueView"in t&&n(29,y=t.uniqueView),"status"in t&&n(30,b=t.status),"single"in t&&n(2,v=t.single)},[m,h,v,I,E,r,o,i,a,s,c,l,C,A,async()=>{let t=[],e=[],r={};if(n(4,E=[]),_)if(w){if(u){const e=d.split("-")[1].slice(0,-4),n="input."+d+"[name='_id']",o=document.querySelector(n).value;r={[_]:u},b&&(r.$or=[{status:!0},{[e]:o}]),t=await Request.getSectionView(p,r),t=t.sort((t,n)=>{const r=t=>(t[e]||"z").toString()+t[g];return S(r(t),r(n))})}}else y?u&&(r={[_]:u,status:!0},Object.entries(y).map(([t,n])=>{n?.length&&(r[t]={$in:n}),e.push(t)}),t=await Request.getSectionView(p,r),t=t.sort((t,e)=>{const n=t=>(m.includes(t[g])?"0-":"1-")+t[g];return S(n(t),n(e))}),n(4,E=t.map(t=>{const n=[t[g]];return e.map(e=>n.push(t[e])),n}))):$?(t=await Request.getSection(p,_,u,$),t=t.sort((t,e)=>S(t,e))):(t=await Request.getSection(p,_,u,!1,b),t=t.sort((t,e)=>{const n=t=>(m.includes(t[g])?"0-":"1-")+t[g];return S(n(t),n(e))}));else r={},u&&!Array.isArray(u)&&(r._id=u),t=await Request.getSectionView(p,r);const o=await Request.getSchemaByClass(p),i=[];if(f){const e=o.items[0].name,r=o.items[1].name,i=o.list[0].name,a=t.find(t=>t[e]===f);t=a?a[i]:[],n(21,g=r)}let a;return t.map(t=>{let e=t[g];if(e||p!==g||(n(21,g=o.items[0].name),e=t[g]),Array.isArray(e))for(const t of e){let e=t;"string"!=typeof t&&(e=Array.from(Object.values(t)).filter(t=>!!t&&24!==t?.length).join(", ")),i.push(e||[])}else f&&(e=o.list[0].item.map(e=>t[e.name]||"")),i.push(e||[])}),a=f?o.list[0].item.map(t=>t.designation):[o.items.find(t=>t.name===g)?.designation],e=e.map(t=>o.items.find(e=>e.name===t)?.designation),{list:f?i:i.flat(),items:[...a,...e]}},({detail:{value:t}})=>{n(3,I=t)},(t,e)=>{if(!e)return!0;return!!(Array.isArray(t)?t.join(" "):t).toLowerCase().includes(e.toLowerCase())},()=>{n(3,I="")},t=>()=>{const e=document.getElementsByName(A),n=[];e.forEach((e,r)=>{e.checked&&n.push(t[+e.attributes.data.value])}),r("choose",{list:n})},t=>()=>{document.getElementsByName(A).forEach((t,e)=>{t.checked=!t.checked})},t=>e=>{if("TD"===e.target?.nodeName){const e=Array.isArray(t)?t[0]:t;v?r("choose",{list:[].concat(e)}):(n(0,m=m.includes(e)?m.filter(t=>t!==e):m.concat(e)),r("choose",{list:m}))}},g,d,u,f,p,_,w,$,y,b,()=>r("back"),function(t){I=t,n(3,I)}]}class ComposedList extends SvelteComponent{constructor(t){super(),document_1$9.getElementById("svelte-1m010ne-style")||add_css$n(),init(this,t,instance$r,create_fragment$r,safe_not_equal,{classId:22,id:23,designation:1,selection:0,refDoc:24,tableName:25,idName:26,target:21,view:27,unique:28,uniqueView:29,status:30,single:2},[-1,-1])}}const{document:document_1$8}=globals;function add_css$m(){var t=element("style");t.id="svelte-1rbaejz-style",t.textContent=".feather.svelte-1rbaejz{position:absolute;top:1em;right:0.5em;color:#4300b0}.showNumber.svelte-1rbaejz{position:absolute;display:inline-block;width:3.5em;text-align:right;top:1em;left:-4em;color:#4300b0}.showNumber.disabled.svelte-1rbaejz{color:#888 !important}.autocomplete .notice,.autocomplete .load-more-options,.autocomplete .show-on-focus,.autocomplete.disabled .chip button.btn,.autocomplete.disabled .chip+.autocomplete-field input{display:none}.autocomplete-field input.invalid{border:1px red solid !important}.autocomplete.disabled .chip{height:2.25em !important;padding-right:0.75em !important}",append(document_1$8.head,t)}function create_if_block_5$3(t){let e,n,r,o,i,a=t[7].length+"";return{c(){e=element("span"),n=text("("),r=text(a),o=text(")"),attr(e,"class",i=null_to_empty(t[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")},m(t,i){insert(t,e,i),append(e,n),append(e,r),append(e,o)},p(t,n){128&n[0]&&a!==(a=t[7].length+"")&&set_data(r,a),2&n[0]&&i!==(i=null_to_empty(t[1]?"showNumber disabled":"showNumber")+" svelte-1rbaejz")&&attr(e,"class",i)},d(t){t&&detach(e)}}}function create_load_more_options_message_slot$1(t){let e;return{c(){e=element("div"),attr(e,"class","load-more-options"),attr(e,"slot","load-more-options-message")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_1$b(t){let e,n,r,o;const i=[create_if_block_2$6,create_if_block_3$3,create_if_block_4$3],a=[];function s(t,e){return!t[16].single&&t[7]?.length?0:t[17]?1:t[14]&&t[16].view&&t[16].maxItem?2:-1}return~(e=s(t))&&(n=a[e]=i[e](t)),{c(){n&&n.c(),r=empty()},m(t,n){~e&&a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?~e&&a[e].p(t,o):(n&&(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros()),~e?(n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r)):n=null)},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){~e&&a[e].d(t),t&&detach(r)}}}function create_if_block_4$3(t){let e,n,r,o,i;return n=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Übernehmen"),attr(e,"class","feather pointer svelte-1rbaejz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[26]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_3$3(t){let e,n,r,o,i;return n=new CommandIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title",t[17].title||"Generieren"),attr(e,"class","feather pointer svelte-1rbaejz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[25]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block_2$6(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Löschen"),attr(e,"class","feather pointer svelte-1rbaejz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[27]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block$m(t){let e,n,r;function o(e){t[37](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$8]},$$scope:{ctx:t}};return void 0!==t[10]&&(i.open=t[10]),e=new t[11]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};53&r[0]|32768&r[1]&&(o.$$scope={dirty:r,ctx:t}),!n&&1024&r[0]&&(n=!0,o.open=t[10],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot$8(t){let e,n;return e=new ComposedList({props:{classId:t[2],selection:t[0],refDoc:t[19],view:t[15],status:t[18],unique:t[16].unique&&t[4].name,uniqueView:t[16].view&&{[t[16].view]:t[5][t[16].view]},id:t[5][t[21]||t[20]],tableName:t[20],idName:t[21],designation:t[4].designation,target:t[4].name,single:t[16].single}}),e.$on("choose",t[24]),e.$on("back",t[23]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4&n[0]&&(r.classId=t[2]),1&n[0]&&(r.selection=t[0]),16&n[0]&&(r.unique=t[16].unique&&t[4].name),32&n[0]&&(r.uniqueView=t[16].view&&{[t[16].view]:t[5][t[16].view]}),32&n[0]&&(r.id=t[5][t[21]||t[20]]),16&n[0]&&(r.designation=t[4].designation),16&n[0]&&(r.target=t[4].name),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$q(t){let e,n,r,o,i,a,s,c,l,d=!t[16].single&&t[7]?.length&&create_if_block_5$3(t);function u(e){t[35](e)}function h(e){t[36](e)}let m={id:t[3],name:t[3],class:t[3],readonly:t[13],disabled:t[1],required:t[6],placeholder:t[8],getOptions:getOptions,minSearchLength:"3",$$slots:{"load-more-options-message":[create_load_more_options_message_slot$1]},$$scope:{ctx:t}};void 0!==t[7]&&(m.selection=t[7]),void 0!==t[9]&&(m.maxOptions=t[9]),r=new t[12]({props:m}),binding_callbacks.push(()=>bind(r,"selection",u)),binding_callbacks.push(()=>bind(r,"maxOptions",h)),r.$on("change",t[22]);let f=!t[1]&&create_if_block_1$b(t),p=t[10]&&create_if_block$m(t);return{c(){e=element("div"),d&&d.c(),n=space(),create_component(r.$$.fragment),a=space(),f&&f.c(),s=space(),p&&p.c(),c=empty(),set_style(e,"position","relative")},m(t,o){insert(t,e,o),d&&d.m(e,null),append(e,n),mount_component(r,e,null),append(e,a),f&&f.m(e,null),insert(t,s,o),p&&p.m(t,o),insert(t,c,o),l=!0},p(t,a){!t[16].single&&t[7]?.length?d?d.p(t,a):(d=create_if_block_5$3(t),d.c(),d.m(e,n)):d&&(d.d(1),d=null);const s={};8&a[0]&&(s.id=t[3]),8&a[0]&&(s.name=t[3]),8&a[0]&&(s.class=t[3]),2&a[0]&&(s.disabled=t[1]),64&a[0]&&(s.required=t[6]),256&a[0]&&(s.placeholder=t[8]),32768&a[1]&&(s.$$scope={dirty:a,ctx:t}),!o&&128&a[0]&&(o=!0,s.selection=t[7],add_flush_callback(()=>o=!1)),!i&&512&a[0]&&(i=!0,s.maxOptions=t[9],add_flush_callback(()=>i=!1)),r.$set(s),t[1]?f&&(group_outros(),transition_out(f,1,1,()=>{f=null}),check_outros()):f?(f.p(t,a),2&a[0]&&transition_in(f,1)):(f=create_if_block_1$b(t),f.c(),transition_in(f,1),f.m(e,null)),t[10]?p?(p.p(t,a),1024&a[0]&&transition_in(p,1)):(p=create_if_block$m(t),p.c(),transition_in(p,1),p.m(c.parentNode,c)):p&&(group_outros(),transition_out(p,1,1,()=>{p=null}),check_outros())},i(t){l||(transition_in(r.$$.fragment,t),transition_in(f),transition_in(p),l=!0)},o(t){transition_out(r.$$.fragment,t),transition_out(f),transition_out(p),l=!1},d(t){t&&detach(e),d&&d.d(),destroy_component(r),f&&f.d(),t&&detach(s),p&&p.d(t),t&&detach(c)}}}async function*getOptions(t){yield[{name:t}]}function instance$q(t,e,n){const r=createEventDispatcher(),{Modal:o,Autocomplete:i}=getAttractions;let{classId:a}=e,{id:s}=e,{item:c}=e,{record:l}=e,{value:d}=e,{noForm:u=!1}=e,{disabled:h}=e,{formnovalidate:m}=e,{numberInput:f}=e,{praefix:p}=e,{toDelete:_}=e,{reqQuantity:g}=e,{notifyList:w}=e;const{properties:$={}}=c;let{placeholder:y,hint:b,readonly:v,required:I=!1,lookup:C="",view:E=!1,multi:A,max:S=1e3,generate:k=!1,status:T=!0,refDoc:R}=$;const[N,D]=C.split(":");let x=!1,O=d.map&&d.map(t=>({name:t}))||[];h||=v,h&&(y="");const M=({detail:t})=>{let e=[];t.value.map(t=>{const n=t.name?.split(",");e=e.concat(n)}),n(7,O=e.map(t=>({name:t.trim()})));const o=O.map(t=>t.name);r("blur",{value:o}),r("multi",{view:A.view,lookup:C,name:c.name,value:o})};onMount(async()=>{r("multi",{view:A.view,lookup:C,name:c.name,value:d});const t=document.getElementById(s);t.classList.add(a),!v&&C&&t.addEventListener("focus",P)});const P=()=>{if(C){document.getElementById(s).blur();const t=g||S;(A.unique||O.length<t)&&n(10,x=!0)}},B=()=>{n(10,x&&=!1)},F=({detail:t})=>{const e=t.list.map(t=>Array.isArray(t)?t[0]:t);n(7,O=e.map(t=>({name:t}))),r("blur",{value:e}),r("multi",{view:A.view,lookup:C,name:c.name,value:e}),B()},L=async()=>{const t={[D]:l[D]},e=await Request.getSectionView(N,t),n=Array.from({length:e.length},(t,n)=>e[n][c.name]);F({detail:{name:c.name,list:n}})},q=(t=!1)=>{if(h||!A.required)return;const e=A.maxItem;if(!e||A.unique)return;n(9,S=!1!==t?t:g||l[e]||0);const o=O?.length!=S,i=document.getElementById(s);i?.classList?.toggle("invalid",o),r("invalid",{idx:p,value:o})};return t.$$set=t=>{"classId"in t&&n(2,a=t.classId),"id"in t&&n(3,s=t.id),"item"in t&&n(4,c=t.item),"record"in t&&n(5,l=t.record),"value"in t&&n(0,d=t.value),"noForm"in t&&n(28,u=t.noForm),"disabled"in t&&n(1,h=t.disabled),"formnovalidate"in t&&n(29,m=t.formnovalidate),"numberInput"in t&&n(30,f=t.numberInput),"praefix"in t&&n(31,p=t.praefix),"toDelete"in t&&n(32,_=t.toDelete),"reqQuantity"in t&&n(33,g=t.reqQuantity),"notifyList"in t&&n(34,w=t.notifyList)},t.$$.update=()=>{48&t.$$.dirty[0]&&l&&""===l[c.name]&&n(7,O=[]),48&t.$$.dirty[0]&&l&&Array.isArray(l[c.name])&&n(7,O=l[c.name].map(t=>({name:t}))),16&t.$$.dirty[0]|2&t.$$.dirty[1]&&_&&_===c.name&&n(7,O=[]),128&t.$$.dirty[0]&&O&&(n(0,d=O.map&&O.map(t=>t.name)||[]),q()),1073741824&t.$$.dirty[0]&&((t={})=>{const{item:e,value:n,idx:r}=t;void 0!==p&&p!==r||e&&e.name===A.maxItem&&q(n)})(f),536870976&t.$$.dirty[0]&&n(6,I=I&&!m),8&t.$$.dirty[1]&&(async t=>{if(void 0===p)return;const{itemName:e,value:o}=t||{};if(o){if(c.refItem&&c.refItem?.split(".")[0]===e){let[t,e]=c.refItem.split(".");if(Array.isArray(o)){if(t=t.slice(0,-1),!o.length)return r("record",{itemName:"quantity",value:0}),void n(7,O=[]);const i={_id:{$in:o}},a=await Request.getSectionView(t,i);let s=[];for(const t of a)t[e]&&(s=s.concat(t[e][0][c.name]));if(!s.length)return;r("record",{itemName:"quantity",value:s.length}),n(7,O=s.map(t=>({name:t}))),M({detail:{value:O}})}else{const i=await Request.getTask(t,o);if(!i||!i[e])return;const a=i[e];if(!Array.isArray(a)&&!a.length)return;const s=a[p][c.name];r("record",{itemName:"quantity",value:s?.length||0}),n(7,O=s&&s.map(t=>({name:t})))}}if(c.refItem2&&c.refItem2?.split(".")[0]===e){let[t,e]=c.refItem2.split(".");if(Array.isArray(o))if(Array.isArray(o)){if(t=t.slice(0,-1),!o.length)return r("record",{itemName:"quantity",value:0}),void n(7,O=[]);const i={_id:{$in:o}},a=await Request.getSectionView(t,i);let s=[];for(const t of a)t[e]&&(s=s.concat(t[e][0][c.name]));if(!s.length)return;r("record",{itemName:"quantity",value:s.length}),n(7,O=s.map(t=>({name:t}))),M({detail:{value:O}})}else{const i=await Request.getTask(t,o);if(!i||!i[e])return;const a=i[e];if(!Array.isArray(a)&&!a.length)return;const s=a[p][c.name];r("record",{itemName:"quantity",value:s?.length||0}),n(7,O=s&&s.map(t=>({name:t})))}}setTimeout(q,250)}})(w)},[d,h,a,s,c,l,I,O,y,S,x,o,i,v,C,E,A,k,T,R,N,D,M,B,F,()=>{const t=l[k.itemQuantity]||g;if(!t)return;const e=k.prefix||"",n=l[k.variable]||"",r=k.len||5,o=Array.from({length:t},(t,o)=>e+n+"-"+o.toString().padStart(r,"0"));F({detail:{name:c.name,list:o}})},async()=>{if(!0===E)return L();const t=g||l[A.maxItem];if(!t)return;let e={};D&&(e={[D]:l[D]}),T&&(e.status=!0);const n=[].concat(l[A.view]||[]);n.length&&(e[A.view]={$in:n});const r=await Request.getSectionView(N,e),o=Array.from({length:t<r.length?t:r.length},(t,e)=>r[e][c.name]);F({detail:{name:c.name,list:o}})},()=>{F({detail:{name:c.name,list:[]}})},u,m,f,p,_,g,w,function(t){O=t,n(7,O),n(5,l),n(4,c),n(32,_)},function(t){S=t,n(9,S)},function(t){x=t,n(10,x)}]}class InputMulti extends SvelteComponent{constructor(t){super(),document_1$8.getElementById("svelte-1rbaejz-style")||add_css$m(),init(this,t,instance$q,create_fragment$q,safe_not_equal,{classId:2,id:3,item:4,record:5,value:0,noForm:28,disabled:1,formnovalidate:29,numberInput:30,praefix:31,toDelete:32,reqQuantity:33,notifyList:34},[-1,-1])}}function add_css$l(){var t=element("style");t.id="svelte-9up2nn-style",t.textContent=".feather.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-9up2nn{position:absolute;top:0.75em;left:0.5em;color:light-gray;margin-left:-2em}",append(document.head,t)}function create_else_block$e(t){let e,n,r;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-9up2nn")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block$l(t){let e,n,r,o,i;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-9up2nn")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[9]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$p(t){let e,n,r,o,i,a;n=new t[8]({props:{inputClass:t[0],disabled:t[1],formnovalidate:t[2],readonly:t[3],required:t[4],id:t[5],name:t[6],value:t[7]}}),n.$on("change",t[12]);const s=[create_if_block$l,create_else_block$e],c=[];function l(t,e){return t[7]?0:1}return o=l(t),i=c[o]=s[o](t),{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i.c(),set_style(e,"position","relative")},m(t,i){insert(t,e,i),mount_component(n,e,null),append(e,r),c[o].m(e,null),a=!0},p(t,[r]){const a={};1&r&&(a.inputClass=t[0]),2&r&&(a.disabled=t[1]),4&r&&(a.formnovalidate=t[2]),8&r&&(a.readonly=t[3]),16&r&&(a.required=t[4]),32&r&&(a.id=t[5]),64&r&&(a.name=t[6]),128&r&&(a.value=t[7]),n.$set(a);let d=o;o=l(t),o===d?c[o].p(t,r):(group_outros(),transition_out(c[d],1,1,()=>{c[d]=null}),check_outros(),i=c[o],i?i.p(t,r):(i=c[o]=s[o](t),i.c()),transition_in(i,1),i.m(e,null))},i(t){a||(transition_in(n.$$.fragment,t),transition_in(i),a=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),a=!1},d(t){t&&detach(e),destroy_component(n),c[o].d()}}}const getMapLink=exports("getMapLink",async t=>{const{street:e,houseNo:n,postcode:r,location:o,country:i}=t,a=[e&&n?e+" "+n:e,r&&o?r+" "+o:r||o||"",i&&(await Request.getTask("country",i)).designation].filter(t=>!!t).join(", ");return"https://bing.com/maps/default.aspx?where1="+encodeURIComponent(a)});function instance$p(t,e,n){const{TextField:r}=getAttractions;let{inputClass:o}=e,{disabled:i}=e,{formnovalidate:a}=e,{readonly:s}=e,{required:c}=e,{id:l}=e,{name:d}=e,{value:u}=e,{record:h}=e,{item:m}=e;return t.$$set=t=>{"inputClass"in t&&n(0,o=t.inputClass),"disabled"in t&&n(1,i=t.disabled),"formnovalidate"in t&&n(2,a=t.formnovalidate),"readonly"in t&&n(3,s=t.readonly),"required"in t&&n(4,c=t.required),"id"in t&&n(5,l=t.id),"name"in t&&n(6,d=t.name),"value"in t&&n(7,u=t.value),"record"in t&&n(10,h=t.record),"item"in t&&n(11,m=t.item)},[o,i,a,s,c,l,d,u,r,async()=>{if(!u)return;const t=d.includes(".")?h[d.split(".")[0]]:h,e=await getMapLink(t);window.open(e,"_blank")},h,m,function(e){bubble(t,e)}]}class InputMap extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-9up2nn-style")||add_css$l(),init(this,t,instance$p,create_fragment$p,safe_not_equal,{inputClass:0,disabled:1,formnovalidate:2,readonly:3,required:4,id:5,name:6,value:7,record:10,item:11})}}const{document:document_1$7}=globals;function add_css$k(){var t=element("style");t.id="svelte-wpjws5-style",t.textContent=".feather.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:#4300b0;margin-left:-2em}.feather2.svelte-wpjws5{position:absolute;top:1em;left:0.5em;color:light-gray;margin-left:-2em}.inputAutoComplete .autocomplete .chip,.inputAutoComplete .autocomplete .shown-on-focus{display:none !important}",append(document_1$7.head,t)}function create_load_more_options_message_slot(t){let e;return{c(){e=element("div"),attr(e,"class","load-more-options"),attr(e,"slot","load-more-options-message")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block$k(t){let e,n,r,o;const i=[create_if_block_1$a,create_else_block$d],a=[];function s(t,e){return t[0]?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_else_block$d(t){let e,n,r;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-wpjws5")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block_1$a(t){let e,n,r,o,i;return n=new MapPinIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-wpjws5")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[8]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$o(t){let e,n,r,o,i,a,s;function c(e){t[17](e)}function l(e){t[18](e)}function d(e){t[19](e)}let u={id:t[1],name:t[1],class:t[1],minSearchLength:"1",maxOptions:"1",getOptions:t[7],$$slots:{"load-more-options-message":[create_load_more_options_message_slot]},$$scope:{ctx:t}};void 0!==t[0]&&(u.value=t[0]),void 0!==t[2]&&(u.selection=t[2]),void 0!==t[3]&&(u.searchQuery=t[3]),n=new t[4]({props:u}),binding_callbacks.push(()=>bind(n,"value",c)),binding_callbacks.push(()=>bind(n,"selection",l)),binding_callbacks.push(()=>bind(n,"searchQuery",d)),n.$on("change",t[6]);let h=t[5]&&create_if_block$k(t);return{c(){e=element("div"),create_component(n.$$.fragment),a=space(),h&&h.c(),set_style(e,"position","relative"),attr(e,"class","inputAutoComplete")},m(t,r){insert(t,e,r),mount_component(n,e,null),append(e,a),h&&h.m(e,null),s=!0},p(t,e){const a={};2&e[0]&&(a.id=t[1]),2&e[0]&&(a.name=t[1]),2&e[0]&&(a.class=t[1]),16&e[1]&&(a.$$scope={dirty:e,ctx:t}),!r&&1&e[0]&&(r=!0,a.value=t[0],add_flush_callback(()=>r=!1)),!o&&4&e[0]&&(o=!0,a.selection=t[2],add_flush_callback(()=>o=!1)),!i&&8&e[0]&&(i=!0,a.searchQuery=t[3],add_flush_callback(()=>i=!1)),n.$set(a),t[5]&&h.p(t,e)},i(t){s||(transition_in(n.$$.fragment,t),transition_in(h),s=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(h),s=!1},d(t){t&&detach(e),destroy_component(n),h&&h.d()}}}function instance$o(t,e,n){const{Autocomplete:r}=getAttractions,o=createEventDispatcher();let{classId:i}=e,{id:a}=e,{item:s}=e,{name:c}=e,{listName:l}=e,{record:d}=e,{value:u}=e,{noForm:h=!1}=e,{disabled:m}=e,{formnovalidate:f}=e;const{autocomplete:{input:p,min:_,url:g,output:w},format:$}=s.properties,y=[].concat(p),{name:b}=w,v="map"===$;let I,C=u,E=!1;onMount(()=>{const t=document.querySelector("."+s.name+" .autocomplete input");t&&(t.addEventListener("focus",k),t.addEventListener("keyup",S),t.addEventListener("keydown",A));const e=document.getElementById(a);e&&e.classList.add(i)});const A=t=>{E=8===t.keyCode||32===t.keyCode},S=t=>{8===t.keyCode&&""===C&&n(0,u="")},k=async()=>{if(_){const t=y[0].name;if((l?d[l][t]:d[t]).length!==_)return}const t=await T();if(t?.length)if(1===t.length){if(u.startsWith(t[0].name))return;n(3,C=n(0,u=t[0].name)),N(u)}else t.find(t=>(C||"").startsWith(t.name))||u||n(3,C=" ");else u||n(3,C="")},T=async(t="")=>{const e=await fetch(g+"?"+R()+"&name=%5E"+t.trim());if(!e.ok)return;const n=e.headers.get("Content-Type").split(";")[0];let r=[];try{if("text/json"===n){const t=await e.text();r=JSON.parse(t||[])}else"application/json"===n&&(r=await e.json())}catch{}return r.map(t=>({name:t[b]}))},R=()=>y.map(({name:t,refItem:e})=>`${e}=${(l?d[l][t]:d[t]).split(" ")[0]}`).join("&"),N=t=>{o("blur",{value:t})};return t.$$set=t=>{"classId"in t&&n(9,i=t.classId),"id"in t&&n(1,a=t.id),"item"in t&&n(10,s=t.item),"name"in t&&n(11,c=t.name),"listName"in t&&n(12,l=t.listName),"record"in t&&n(13,d=t.record),"value"in t&&n(0,u=t.value),"noForm"in t&&n(14,h=t.noForm),"disabled"in t&&n(15,m=t.disabled),"formnovalidate"in t&&n(16,f=t.formnovalidate)},[u,a,I,C,r,v,({detail:{value:t}})=>{t.length&&n(3,C=n(0,u=t[0].name)),n(2,I=[]),N(u)},async function*(t){if(E||u&&t.startsWith(u))return n(0,u=t),void N(u);const e=await T(t);if(!e?.length)return n(0,u=t),void N(u);1===e.length?(n(3,C=n(0,u=e[0].name)),n(2,I=[]),N(u)):yield e},async()=>{if(!u)return;const t=c.includes(".")?d[c.split(".")[0]]:d,e=await getMapLink(t);window.open(e,"_blank")},i,s,c,l,d,h,m,f,function(t){u=t,n(0,u)},function(t){I=t,n(2,I)},function(t){C=t,n(3,C)}]}class InputAutocomplete extends SvelteComponent{constructor(t){super(),document_1$7.getElementById("svelte-wpjws5-style")||add_css$k(),init(this,t,instance$o,create_fragment$o,safe_not_equal,{classId:9,id:1,item:10,name:11,listName:12,record:13,value:0,noForm:14,disabled:15,formnovalidate:16},[-1,-1])}}const{document:document_1$6}=globals;function add_css$j(){var t=element("style");t.id="svelte-14hcfjl-style",t.textContent=".feather.svelte-14hcfjl.svelte-14hcfjl{position:absolute;top:2em;right:0.5em;color:#326173}.eList.svelte-14hcfjl.svelte-14hcfjl{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-14hcfjl table.svelte-14hcfjl{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-14hcfjl table thead.svelte-14hcfjl{position:sticky;top:0;background:#326173;color:white}.eList.svelte-14hcfjl table tbody tr.svelte-14hcfjl{height:2.3em}th.svelte-14hcfjl.svelte-14hcfjl,td.svelte-14hcfjl.svelte-14hcfjl{padding-left:0.4em;padding-right:0.4em}tr.pointer.svelte-14hcfjl.svelte-14hcfjl:hover{background-color:#DAE1E5}tr.active.svelte-14hcfjl.svelte-14hcfjl{color:#326173;background-color:#fcebd5}.form--buttons.svelte-14hcfjl.svelte-14hcfjl{display:flex;gap:1em;padding:0.5em 0}",append(document_1$6.head,t)}function get_then_context(t){t[26]=t[28].list,t[27]=t[28].items}function get_each_context$6(t,e,n){const r=t.slice();return r[29]=e[n],r}function get_each_context_1$3(t,e,n){const r=t.slice();return r[32]=e[n],r}function get_each_context_2$2(t,e,n){const r=t.slice();return r[32]=e[n],r}function create_catch_block$4(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$4(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w;function $(e){t[23](e)}get_then_context(t),n=new t[7]({props:{outline:!0,$$slots:{default:[create_default_slot_1$5]},$$scope:{ctx:t}}}),n.$on("click",t[22]);let y={id:t[8]};void 0!==t[1]&&(y.value=t[1]),a=new t[6]({props:y}),binding_callbacks.push(()=>bind(a,"value",$)),a.$on("input",t[12]),d=new DeleteIcon({props:{size:"18"}});let b=t[27]?.length&&create_if_block_2$5(t),v=t[26]?.length&&create_if_block$j(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),o=element("div"),i=text("Suchen: "),create_component(a.$$.fragment),c=space(),l=element("span"),create_component(d.$$.fragment),u=space(),h=element("div"),m=element("table"),b&&b.c(),f=space(),p=element("tbody"),v&&v.c(),attr(e,"class","form--buttons svelte-14hcfjl"),attr(l,"class","feather pointer svelte-14hcfjl"),set_style(o,"margin-bottom","1em"),set_style(o,"position","relative"),attr(m,"striped",""),attr(m,"class","svelte-14hcfjl"),attr(h,"class","eList svelte-14hcfjl")},m(s,$){insert(s,e,$),mount_component(n,e,null),insert(s,r,$),insert(s,o,$),append(o,i),mount_component(a,o,null),append(o,c),append(o,l),mount_component(d,l,null),insert(s,u,$),insert(s,h,$),append(h,m),b&&b.m(m,null),append(m,f),append(m,p),v&&v.m(p,null),_=!0,g||(w=listen(l,"click",t[14]),g=!0)},p(t,e){get_then_context(t);const r={};64&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r);const o={};!s&&2&e[0]&&(s=!0,o.value=t[1],add_flush_callback(()=>s=!1)),a.$set(o),t[27]?.length&&b.p(t,e),t[26]?.length&&v.p(t,e)},i(t){_||(transition_in(n.$$.fragment,t),transition_in(a.$$.fragment,t),transition_in(d.$$.fragment,t),_=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a.$$.fragment,t),transition_out(d.$$.fragment,t),_=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),t&&detach(o),destroy_component(a),destroy_component(d),t&&detach(u),t&&detach(h),b&&b.d(),v&&v.d(),g=!1,w()}}}function create_default_slot_1$5(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_2$5(t){let e,n,r=t[27],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_2$2(get_each_context_2$2(t,r,e));return{c(){e=element("thead"),n=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();attr(n,"class","svelte-14hcfjl"),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n);for(let t=0;t<o.length;t+=1)o[t].m(n,null)},p(t,e){if(2048&e[0]){let i;for(r=t[27],i=0;i<r.length;i+=1){const a=get_each_context_2$2(t,r,i);o[i]?o[i].p(a,e):(o[i]=create_each_block_2$2(a),o[i].c(),o[i].m(n,null))}for(;i<o.length;i+=1)o[i].d(1);o.length=r.length}},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_2$2(t){let e,n,r=t[32]?.designation+"";return{c(){e=element("th"),n=text(r),attr(e,"class","svelte-14hcfjl")},m(t,r){insert(t,e,r),append(e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block$j(t){let e,n=t[26],r=[];for(let e=0;e<n.length;e+=1)r[e]=create_each_block$6(get_each_context$6(t,n,e));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,n){for(let e=0;e<r.length;e+=1)r[e].m(t,n);insert(t,e,n)},p(t,o){if(11779&o[0]){let i;for(n=t[26],i=0;i<n.length;i+=1){const a=get_each_context$6(t,n,i);r[i]?r[i].p(a,o):(r[i]=create_each_block$6(a),r[i].c(),r[i].m(e.parentNode,e))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){destroy_each(r,t),t&&detach(e)}}}function create_if_block_1$9(t){let e,n,r=t[27],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_1$3(get_each_context_1$3(t,r,e));return{c(){e=element("tr");for(let t=0;t<o.length;t+=1)o[t].c();n=space(),attr(e,"class","pointer svelte-14hcfjl"),toggle_class(e,"active",t[29]._id===t[0])},m(t,r){insert(t,e,r);for(let t=0;t<o.length;t+=1)o[t].m(e,null);append(e,n)},p(t,i){if(3584&i[0]){let a;for(r=t[27],a=0;a<r.length;a+=1){const s=get_each_context_1$3(t,r,a);o[a]?o[a].p(s,i):(o[a]=create_each_block_1$3(s),o[a].c(),o[a].m(e,n))}for(;a<o.length;a+=1)o[a].d(1);o.length=r.length}2049&i[0]&&toggle_class(e,"active",t[29]._id===t[0])},d(t){t&&detach(e),destroy_each(o,t)}}}function create_each_block_1$3(t){let e,n,r,o,i=t[9](t[29],t[32])+"";return{c(){e=element("td"),n=text(i),attr(e,"class","svelte-14hcfjl")},m(i,a){insert(i,e,a),append(e,n),r||(o=listen(e,"click",stop_propagation(t[10](t[29]))),r=!0)},p(e,n){t=e},d(t){t&&detach(e),r=!1,o()}}}function create_each_block$6(t){let e,n=t[13](t[29],t[27],t[1]),r=n&&create_if_block_1$9(t);return{c(){r&&r.c(),e=empty()},m(t,n){r&&r.m(t,n),insert(t,e,n)},p(t,o){2&o[0]&&(n=t[13](t[29],t[27],t[1])),n?r?r.p(t,o):(r=create_if_block_1$9(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){r&&r.d(t),t&&detach(e)}}}function create_pending_block$4(t){let e,n;return e=new t[5]({}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p:noop,i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$7(t){let e,n,r,o;e=new t[4]({});let i={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$4,then:create_then_block$4,catch:create_catch_block$4,value:28,blocks:[,,,]};return handle_promise(t[11](),i),{c(){create_component(e.$$.fragment),n=space(),r=empty(),i.block.c()},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),i.block.m(t,i.anchor=a),i.mount=()=>r.parentNode,i.anchor=r,o=!0},p(e,n){update_await_block_branch(i,t=e,n)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i.block),o=!0)},o(t){transition_out(e.$$.fragment,t);for(let t=0;t<3;t+=1){transition_out(i.blocks[t])}o=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),i.block.d(t),i.token=null,i=null}}}function create_fragment$n(t){let e,n;return e=new t[3]({props:{title:"Auswahl",class:"eList",$$slots:{default:[create_default_slot$7]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};3&n[0]|64&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance$n(t,e,n){const r=createEventDispatcher(),{Dialog:o,Divider:i,Loading:a,TextField:s,Button:c}=getAttractions;let{item:l}=e,{className:d}=e,{classId:u}=e,{rowId:h}=e,{viewName:m}=e,{viewValue:f}=e,{recordId:p}=e,{filter:_}=e,g="",w=u+Math.floor(9e3*Math.random()+1e3).toString()+"search";const $=(t,e)=>{if(!e)return;const n=t[e.name];return"boolean"==typeof n?checkBoolean(n):checkDate(t[`_${e.name}`]||t[e.name]||"")},y=Request.getSchemaByClass(d);onMount(()=>{window.setTimeout(()=>{const t=document.querySelector("tr.active");t?t.scrollIntoView({block:"end",behavior:"smooth"}):document.getElementById(w)?.focus()},200)}),task_notification.subscribe(async t=>{if(!t)return;const e=await y;t.eventId===e.id&&refreshList(e.class,t.eventId)});return t.$$set=t=>{"item"in t&&n(15,l=t.item),"className"in t&&n(16,d=t.className),"classId"in t&&n(17,u=t.classId),"rowId"in t&&n(0,h=t.rowId),"viewName"in t&&n(18,m=t.viewName),"viewValue"in t&&n(19,f=t.viewValue),"recordId"in t&&n(20,p=t.recordId),"filter"in t&&n(21,_=t.filter)},[h,g,r,o,i,a,s,c,w,$,t=>()=>r("choose",{row:t}),async()=>{const t=await y,e="."+u+"#"+m;document.querySelector(e);let n={[m]:f},r=[];n[m]&&(r=await Request.getSectionView(t.class,n,!0)),_&&(r=r.filter(t=>t._id!=_));const o=t.display;return{list:r,items:await getDisplayItems(o,t,r)}},({detail:{value:t}})=>{n(1,g=t)},(t,e,n)=>{if(!n)return!0;for(const r of e)if($(t,r)?.toLowerCase()?.includes(n.toLowerCase()))return!0;return!1},()=>{n(1,g="")},l,d,u,m,f,p,_,()=>r("back"),function(t){g=t,n(1,g)}]}class ViewList2 extends SvelteComponent{constructor(t){super(),document_1$6.getElementById("svelte-14hcfjl-style")||add_css$j(),init(this,t,instance$n,create_fragment$n,safe_not_equal,{item:15,className:16,classId:17,rowId:0,viewName:18,viewValue:19,recordId:20,filter:21},[-1,-1])}}function add_css$i(){var t=element("style");t.id="svelte-wbrqzu-style",t.textContent=".feather.svelte-wbrqzu{position:absolute;top:0.75em;left:0.5em;color:#4300b0}",append(document.head,t)}function create_catch_block$3(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$3(t){let e,n,r,o,i;function a(e){t[21](e)}let s={id:t[2],name:t[3].name,inputClass:t[5]||t[1],disabled:t[6],formnovalidate:t[7],readonly:t[13],pattern:t[12],required:t[14],style:"padding-left:2em;"};void 0!==t[0]&&(s.value=t[0]),n=new t[10]({props:s}),binding_callbacks.push(()=>bind(n,"value",a));let c=!t[6]&&create_if_block_1$8(t);return{c(){e=element("div"),create_component(n.$$.fragment),o=space(),c&&c.c(),set_style(e,"position","relative")},m(t,r){insert(t,e,r),mount_component(n,e,null),append(e,o),c&&c.m(e,null),i=!0},p(t,o){const i={};4&o&&(i.id=t[2]),8&o&&(i.name=t[3].name),34&o&&(i.inputClass=t[5]||t[1]),64&o&&(i.disabled=t[6]),128&o&&(i.formnovalidate=t[7]),!r&&1&o&&(r=!0,i.value=t[0],add_flush_callback(()=>r=!1)),n.$set(i),t[6]?c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros()):c?(c.p(t,o),64&o&&transition_in(c,1)):(c=create_if_block_1$8(t),c.c(),transition_in(c,1),c.m(e,null))},i(t){i||(transition_in(n.$$.fragment,t),transition_in(c),i=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(c),i=!1},d(t){t&&detach(e),destroy_component(n),c&&c.d()}}}function create_if_block_1$8(t){let e,n,r,o,i;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-wbrqzu")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[17]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_pending_block$3(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_if_block$i(t){let e,n,r;function o(e){t[22](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$6]},$$scope:{ctx:t}};return void 0!==t[8]&&(i.open=t[8]),e=new t[11]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};268435994&r&&(o.$$scope={dirty:r,ctx:t}),!n&&256&r&&(n=!0,o.open=t[8],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot$6(t){let e,n;return e=new ViewList2({props:{item:t[3],className:t[3].refClass,classId:t[1],rowId:"",recordId:t[4]._id,viewName:t[15].selection,viewValue:t[9],filter:t[4]._id}}),e.$on("choose",t[18]),e.$on("back",t[19]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8&n&&(r.item=t[3]),8&n&&(r.className=t[3].refClass),2&n&&(r.classId=t[1]),16&n&&(r.recordId=t[4]._id),512&n&&(r.viewValue=t[9]),16&n&&(r.filter=t[4]._id),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$m(t){let e,n,r,o={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$3,then:create_then_block$3,catch:create_catch_block$3,value:27,blocks:[,,,]};handle_promise(t[16](),o);let i=t[8]&&create_if_block$i(t);return{c(){o.block.c(),e=space(),i&&i.c(),n=empty()},m(t,a){o.block.m(t,o.anchor=a),o.mount=()=>e.parentNode,o.anchor=e,insert(t,e,a),i&&i.m(t,a),insert(t,n,a),r=!0},p(e,[r]){update_await_block_branch(o,t=e,r),t[8]?i?(i.p(t,r),256&r&&transition_in(i,1)):(i=create_if_block$i(t),i.c(),transition_in(i,1),i.m(n.parentNode,n)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){r||(transition_in(o.block),transition_in(i),r=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(o.blocks[t])}transition_out(i),r=!1},d(t){o.block.d(t),o.token=null,o=null,t&&detach(e),i&&i.d(t),t&&detach(n)}}}function instance$m(t,e,n){const{TextField:r,Modal:o}=getAttractions;let{classId:i}=e,{id:a}=e,{item:s}=e,{record:c}=e,{value:l}=e,{noForm:d=!1}=e,{disabled:u}=e,{formnovalidate:h}=e,{praefix:m}=e;const{properties:f={}}=s;let p,{pattern:_,placeholder:g,readonly:w,required:$=!1,view:y}=f,b=!1;const v=()=>{n(8,b=!1)};return t.$$set=t=>{"classId"in t&&n(1,i=t.classId),"id"in t&&n(2,a=t.id),"item"in t&&n(3,s=t.item),"record"in t&&n(4,c=t.record),"value"in t&&n(0,l=t.value),"noForm"in t&&n(5,d=t.noForm),"disabled"in t&&n(6,u=t.disabled),"formnovalidate"in t&&n(7,h=t.formnovalidate),"praefix"in t&&n(20,m=t.praefix)},[l,i,a,s,c,d,u,h,b,p,r,o,_,w,$,y,async()=>(n(9,p=c[y.selection]),!0),()=>{n(8,b=!0)},({detail:t})=>{n(0,l=t.row[y.value?y.value:"_id"]),v()},v,m,function(t){l=t,n(0,l)},function(t){b=t,n(8,b)}]}class InputView extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-wbrqzu-style")||add_css$i(),init(this,t,instance$m,create_fragment$m,safe_not_equal,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7,praefix:20})}}function add_css$h(){var t=element("style");t.id="svelte-5xpzvo-style",t.textContent="select.svelte-5xpzvo{padding:0 0.625em 0.0625em;box-sizing:border-box;width:100%;border:0 solid rgba(0, 0, 0, 0.42);border-bottom-width:0px;border-bottom-width:0.0625em;border-top-left-radius:0.375em;border-top-right-radius:0.375em;background-color:#f5f5f5;outline:none;font-size:1rem;font-weight:300;height:2.8em}select.svelte-5xpzvo:focus{border:none;border-bottom:2px solid #4300b0}",append(document.head,t)}function get_each_context$5(t,e,n){const r=t.slice();return r[12]=e[n][0],r[13]=e[n][1],r}function create_if_block$h(t){let e;function n(t,e){return t[5]&&!0!==t[8]?create_if_block_1$7:create_else_block$c}let r=n(t),o=r(t);return{c(){o.c(),e=empty()},m(t,n){o.m(t,n),insert(t,e,n)},p(t,i){r!==(r=n(t))&&(o.d(1),o=r(t),o&&(o.c(),o.m(e.parentNode,e)))},d(t){o.d(t),t&&detach(e)}}}function create_else_block$c(t){let e;return{c(){e=element("option"),e.textContent="- ",e.selected=!0,e.__value="",e.value=e.__value},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_1$7(t){let e;return{c(){e=element("option"),e.textContent="-- Bitte wählen -- ",e.disabled=!0,e.selected=!0,e.__value="",e.value=e.__value},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_each_block$5(t){let e,n,r,o,i=t[12]+"";return{c(){e=element("option"),n=text(i),e.__value=r=t[13],e.value=e.__value,e.selected=o=t[0]==t[13]},m(t,r){insert(t,e,r),append(e,n)},p(t,a){64&a&&i!==(i=t[12]+"")&&set_data(n,i),64&a&&r!==(r=t[13])&&(e.__value=r,e.value=e.__value),65&a&&o!==(o=t[0]==t[13])&&(e.selected=o)},d(t){t&&detach(e)}}}function create_fragment$l(t){let e,n,r,o,i,a=!t[7]&&create_if_block$h(t),s=t[6],c=[];for(let e=0;e<s.length;e+=1)c[e]=create_each_block$5(get_each_context$5(t,s,e));return{c(){e=element("select"),a&&a.c(),n=empty();for(let t=0;t<c.length;t+=1)c[t].c();attr(e,"class",r=null_to_empty(t[3]||t[4])+" svelte-5xpzvo"),attr(e,"id",t[2]),attr(e,"name",t[2]),e.disabled=t[1],e.required=t[5]},m(r,s){insert(r,e,s),a&&a.m(e,null),append(e,n);for(let t=0;t<c.length;t+=1)c[t].m(e,null);o||(i=listen(e,"change",t[9]),o=!0)},p(t,[n]){if(t[7]||a.p(t,n),65&n){let r;for(s=t[6],r=0;r<s.length;r+=1){const o=get_each_context$5(t,s,r);c[r]?c[r].p(o,n):(c[r]=create_each_block$5(o),c[r].c(),c[r].m(e,null))}for(;r<c.length;r+=1)c[r].d(1);c.length=s.length}24&n&&r!==(r=null_to_empty(t[3]||t[4])+" svelte-5xpzvo")&&attr(e,"class",r),4&n&&attr(e,"id",t[2]),4&n&&attr(e,"name",t[2]),2&n&&(e.disabled=t[1]),32&n&&(e.required=t[5])},i:noop,o:noop,d(t){t&&detach(e),a&&a.d(),destroy_each(c,t),o=!1,i()}}}function instance$l(t,e,n){const r=createEventDispatcher();let{id:o}=e,{item:i}=e,{value:a}=e,{noForm:s=!1}=e,{classId:c}=e,{disabled:l}=e,{required:d}=e,{enum:u,regulation:h,readonly:m}=i.properties;u&&(u=u.map(t=>[t,t])),"businessMonth"===h&&(a||=1,u=[["Januar",1],["Februar",2],["März",3],["April",4],["Mai",5],["Juni",6],["Juli",7],["August",8],["September",9],["Oktober",10],["November",11],["Dezember",12]]),"financialAccounting"===h&&(a||=2024,u=[["2024/2025",2024]]),"valueAddedTax"===h&&(a||=0,u=[["0% Steuerbefreit",0],["8.1% Normalsatz",.081],["2.6% Reduzierter Satz",.026],["3.8% Beherbergung",.038]]),l||=!!m,l||(l=void 0);return t.$$set=t=>{"id"in t&&n(2,o=t.id),"item"in t&&n(10,i=t.item),"value"in t&&n(0,a=t.value),"noForm"in t&&n(3,s=t.noForm),"classId"in t&&n(4,c=t.classId),"disabled"in t&&n(1,l=t.disabled),"required"in t&&n(5,d=t.required)},[a,l,o,s,c,d,u,h,m,t=>r("blur",{value:t.srcElement.value}),i]}class InputSelect extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-5xpzvo-style")||add_css$h(),init(this,t,instance$l,create_fragment$l,safe_not_equal,{id:2,item:10,value:0,noForm:3,classId:4,disabled:1,required:5})}}function create_if_block$g(t){let e,n,r,o,i;return n=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"title","Übernehmen"),attr(e,"class","pointer feather")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[12]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$k(t){let e,n,r,o,i,a,s,c,l;o=new t[8]({props:{id:"dp-"+t[1]+(t[2]?"-"+t[2]:""),value:t[0],readonly:t[5],required:t[7],disabled:t[6],noCalendar:t[9],closeOnSelection:!0}}),o.$on("change",t[11]);let d=t[10]&&create_if_block$g(t);return{c(){e=element("input"),r=space(),create_component(o.$$.fragment),i=space(),d&&d.c(),a=empty(),attr(e,"type","string"),attr(e,"class",n=t[3]||t[4]),attr(e,"id",t[1]),attr(e,"name",t[1]),e.hidden=!0},m(n,u){insert(n,e,u),set_input_value(e,t[0]),insert(n,r,u),mount_component(o,n,u),insert(n,i,u),d&&d.m(n,u),insert(n,a,u),s=!0,c||(l=listen(e,"input",t[18]),c=!0)},p(t,[r]){(!s||24&r&&n!==(n=t[3]||t[4]))&&attr(e,"class",n),(!s||2&r)&&attr(e,"id",t[1]),(!s||2&r)&&attr(e,"name",t[1]),1&r&&set_input_value(e,t[0]);const i={};6&r&&(i.id="dp-"+t[1]+(t[2]?"-"+t[2]:"")),1&r&&(i.value=t[0]),32&r&&(i.readonly=t[5]),128&r&&(i.required=t[7]),64&r&&(i.disabled=t[6]),o.$set(i),t[10]&&d.p(t,r)},i(t){s||(transition_in(o.$$.fragment,t),transition_in(d),s=!0)},o(t){transition_out(o.$$.fragment,t),transition_out(d),s=!1},d(t){t&&detach(e),t&&detach(r),destroy_component(o,t),t&&detach(i),d&&d.d(t),t&&detach(a),c=!1,l()}}}let preValue=new Map;function instance$k(t,e,n){const r=createEventDispatcher(),{DatePicker:o}=getAttractions;let{value:i}=e,{id:a}=e,{item:s}=e,{record:c}=e,{praefix:l}=e,{noForm:d=!1}=e,{classId:u}=e,{eventId:h}=e,{readonly:m}=e,{disabled:f}=e,{required:p}=e,{notifyList:_}=e,{dateInput:g}=e;i||(i=void 0);let w=null;const $=(void 0===l?"":l.toString())+"-"+h+"-"+s.name,y=s.properties?.noCalendar||!1,b=s.properties?.transfer,v=({detail:t})=>{try{n(0,i=applyDate(t.value,i)),void 0!==l&&preValue.set($,new Date(i.valueOf())),I(i)}catch{n(0,i=void 0)}},I=t=>{r("change",{value:new Date(t.valueOf())})};if(void 0!==l&&!i){const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);i=applyDate(e,i)}return t.$$set=t=>{"value"in t&&n(0,i=t.value),"id"in t&&n(1,a=t.id),"item"in t&&n(13,s=t.item),"record"in t&&n(14,c=t.record),"praefix"in t&&n(2,l=t.praefix),"noForm"in t&&n(3,d=t.noForm),"classId"in t&&n(4,u=t.classId),"eventId"in t&&n(15,h=t.eventId),"readonly"in t&&n(5,m=t.readonly),"disabled"in t&&n(6,f=t.disabled),"required"in t&&n(7,p=t.required),"notifyList"in t&&n(16,_=t.notifyList),"dateInput"in t&&n(17,g=t.dateInput)},t.$$.update=()=>{if(1&t.$$.dirty&&i&&!b&&preValue.has($)&&n(0,i=preValue.get($)),65536&t.$$.dirty&&(async t=>{if(null===w){const t=(await Request.getEvent(h)).output.class[0].item;w=t.find(t=>t.properties?.value?.formula)}w&&w.properties.value.formula.argument[0].refItem===s.name&&(t&&t.itemName!==s.name&&!w.properties.value.formula.argument[1].value&&t.itemName!==w.properties.value.formula.argument[1].refItem.split(".")[0]||r("formula",{item:w}))})(_),131072&t.$$.dirty&&((t={})=>{let{ref:e,val:n,t:r,l:o,n:i}=t;if(i&&(n=i),!n||isNaN(new Date(n)))return;if(r)return;if(!e)return;const[a,c]=e.split(".");a===o&&c===s.name&&null!=l&&v({detail:{value:new Date(n)}})})(g),24673&t.$$.dirty&&c&&c[s.name])try{f||m||n(0,i=applyDate(c[s.name],i))}catch{}},[i,a,l,d,u,m,f,p,o,y,b,v,()=>{r("record",{target:b.target,value:i.toISOString()})},s,c,h,_,g,function(){i=this.value,n(0,i),n(14,c),n(13,s),n(6,f),n(5,m)}]}class InputDate extends SvelteComponent{constructor(t){super(),init(this,t,instance$k,create_fragment$k,safe_not_equal,{value:0,id:1,item:13,record:14,praefix:2,noForm:3,classId:4,eventId:15,readonly:5,disabled:6,required:7,notifyList:16,dateInput:17})}}function create_default_slot_2$3(t){let e;return{c(){e=text("Stunden")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_hours_label_slot(t){let e,n;return e=new t[4]({props:{slot:"hours-label",$$slots:{default:[create_default_slot_2$3]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$4(t){let e;return{c(){e=text("Minuten")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_minutes_label_slot(t){let e,n;return e=new t[4]({props:{slot:"minutes-label",$$slots:{default:[create_default_slot_1$4]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot$5(t){let e;return{c(){e=text("Jetzt")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_now_label_slot(t){let e,n;return e=new t[4]({props:{slot:"now-label",$$slots:{default:[create_default_slot$5]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$j(t){let e,n,r,o,i,a,s,c,l;return o=new t[5]({props:{value:t[0],closeOnSelection:!0}}),o.$on("change",t[8]),a=new t[6]({props:{value:t[0],$$slots:{"now-label":[create_now_label_slot],"minutes-label":[create_minutes_label_slot],"hours-label":[create_hours_label_slot]},$$scope:{ctx:t}}}),a.$on("change",t[7]),{c(){e=element("input"),r=space(),create_component(o.$$.fragment),i=space(),create_component(a.$$.fragment),attr(e,"type","string"),attr(e,"class",n=t[2]||t[3]),attr(e,"id",t[1]),attr(e,"name",t[1]),e.hidden=!0},m(n,d){insert(n,e,d),set_input_value(e,t[0]),insert(n,r,d),mount_component(o,n,d),insert(n,i,d),mount_component(a,n,d),s=!0,c||(l=listen(e,"input",t[9]),c=!0)},p(t,[r]){(!s||12&r&&n!==(n=t[2]||t[3]))&&attr(e,"class",n),(!s||2&r)&&attr(e,"id",t[1]),(!s||2&r)&&attr(e,"name",t[1]),1&r&&set_input_value(e,t[0]);const i={};1&r&&(i.value=t[0]),o.$set(i);const c={};1&r&&(c.value=t[0]),4096&r&&(c.$$scope={dirty:r,ctx:t}),a.$set(c)},i(t){s||(transition_in(o.$$.fragment,t),transition_in(a.$$.fragment,t),s=!0)},o(t){transition_out(o.$$.fragment,t),transition_out(a.$$.fragment,t),s=!1},d(t){t&&detach(e),t&&detach(r),destroy_component(o,t),t&&detach(i),destroy_component(a,t),c=!1,l()}}}function instance$j(t,e,n){const r=createEventDispatcher(),{Label:o,DatePicker:i,TimePicker:a}=getAttractions;let{value:s}=e,{id:c}=e,{noForm:l=!1}=e,{classId:d}=e;const u=t=>r("change",{value:t});return t.$$set=t=>{"value"in t&&n(0,s=t.value),"id"in t&&n(1,c=t.id),"noForm"in t&&n(2,l=t.noForm),"classId"in t&&n(3,d=t.classId)},[s,c,l,d,o,i,a,({detail:t})=>{n(0,s=applyTime(t.value,s)),u(s)},({detail:t})=>{n(0,s=applyDate(t.value,s)),u(s)},function(){s=this.value,n(0,s)}]}class InputDateTime extends SvelteComponent{constructor(t){super(),init(this,t,instance$j,create_fragment$j,safe_not_equal,{value:0,id:1,noForm:2,classId:3})}}function add_css$g(){var t=element("style");t.id="svelte-7itxk4-style",t.textContent="div.date-picker.moveLeft div.dropdown.calendar{left:-3em !important}",append(document.head,t)}function create_fragment$i(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_;return u=new t[9]({props:{format:t[5],required:t[3],disabled:t[4],value:t[7],noCalendar:t[10],closeOnSelection:!0}}),u.$on("change",t[11]),m=new t[9]({props:{format:t[6],required:t[3],disabled:t[4],value:t[8],noCalendar:t[10],class:"moveLeft",closeOnSelection:!0}}),m.$on("change",t[12]),{c(){e=element("input"),i=space(),a=element("input"),d=space(),create_component(u.$$.fragment),h=text(" /\n"),create_component(m.$$.fragment),attr(e,"type","string"),attr(e,"class",n=t[1]||t[2]),attr(e,"id",r=t[0]+"_from"),attr(e,"name",o=t[0]+"_from"),e.hidden=!0,attr(a,"type","string"),attr(a,"class",s=t[1]||t[2]),attr(a,"id",c=t[0]+"_to"),attr(a,"name",l=t[0]+"_to"),a.hidden=!0},m(n,r){insert(n,e,r),set_input_value(e,t[7]),insert(n,i,r),insert(n,a,r),set_input_value(a,t[8]),insert(n,d,r),mount_component(u,n,r),insert(n,h,r),mount_component(m,n,r),f=!0,p||(_=[listen(e,"input",t[15]),listen(a,"input",t[16])],p=!0)},p(t,[i]){(!f||6&i&&n!==(n=t[1]||t[2]))&&attr(e,"class",n),(!f||1&i&&r!==(r=t[0]+"_from"))&&attr(e,"id",r),(!f||1&i&&o!==(o=t[0]+"_from"))&&attr(e,"name",o),128&i&&set_input_value(e,t[7]),(!f||6&i&&s!==(s=t[1]||t[2]))&&attr(a,"class",s),(!f||1&i&&c!==(c=t[0]+"_to"))&&attr(a,"id",c),(!f||1&i&&l!==(l=t[0]+"_to"))&&attr(a,"name",l),256&i&&set_input_value(a,t[8]);const d={};32&i&&(d.format=t[5]),8&i&&(d.required=t[3]),16&i&&(d.disabled=t[4]),128&i&&(d.value=t[7]),u.$set(d);const h={};64&i&&(h.format=t[6]),8&i&&(h.required=t[3]),16&i&&(h.disabled=t[4]),256&i&&(h.value=t[8]),m.$set(h)},i(t){f||(transition_in(u.$$.fragment,t),transition_in(m.$$.fragment,t),f=!0)},o(t){transition_out(u.$$.fragment,t),transition_out(m.$$.fragment,t),f=!1},d(t){t&&detach(e),t&&detach(i),t&&detach(a),t&&detach(d),destroy_component(u,t),t&&detach(h),destroy_component(m,t),p=!1,run_all(_)}}}function getDates(t){const e=new Date;let n=e.getFullYear();const r=e.getMonth();e.getDate();let o,i;switch(t){case"currentMonth":o=i=r;break;case"currentYear":o=0,i=o+11;break;case"lastSemiYear":o=r<6?6:0,i=o+5,o>5&&--n;break;case"lastQuarter":o=r<3?9:r<6?0:r<9?3:6,i=o+2,o>8&&--n;break;case"lastMonth":o=i=0===r?11:r-1,11===o&&--n;break;default:o=0,i=o+11,--n}return{first:new Date(n,o,1),last:new Date(n,i+1,0)}}function instance$i(t,e,n){const r=createEventDispatcher(),{DatePicker:o}=getAttractions;let{value:i}=e,{id:a}=e,{item:s}=e,{noForm:c=!1}=e,{classId:l}=e,{required:d}=e,{disabled:u}=e;const{noCalendar:h,preset:m}=s.properties||{};let f="%d.%m.%Y",p="%d.%m.%Y",_=i?.from,g=i?.to;if(m){const{first:t,last:e}=getDates(m);t&&(_=t),e&&(g=e)}"Invalid Date"===_?.toString()&&(_=void 0),"Invalid Date"===g?.toString()&&(g=void 0),u&&(void 0===_&&(f=""),void 0===g&&(p=""));return t.$$set=t=>{"value"in t&&n(13,i=t.value),"id"in t&&n(0,a=t.id),"item"in t&&n(14,s=t.item),"noForm"in t&&n(1,c=t.noForm),"classId"in t&&n(2,l=t.classId),"required"in t&&n(3,d=t.required),"disabled"in t&&n(4,u=t.disabled)},[a,c,l,d,u,f,p,_,g,o,h,({detail:t})=>{n(7,_=applyDate(t.value,_)),g&&_&&g.valueOf()-_.valueOf()<0&&n(7,_=void 0),r("change",{value:_,range:"_from"})},({detail:t})=>{n(8,g=applyDate(t.value,g)),g&&_&&g.valueOf()-_.valueOf()<0&&n(8,g=void 0),r("change",{value:g,range:"_to"})},i,s,function(){_=this.value,n(7,_)},function(){g=this.value,n(8,g)}]}class InputDateRange extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-7itxk4-style")||add_css$g(),init(this,t,instance$i,create_fragment$i,safe_not_equal,{value:13,id:0,item:14,noForm:1,classId:2,required:3,disabled:4})}}const xml2json=(t,e)=>{var n={toObj:function(t){var e={};if(1==t.nodeType){if(t.attributes.length)for(var r=0;r<t.attributes.length;r++)e["@"+t.attributes[r].nodeName]=(t.attributes[r].nodeValue||"").toString();if(t.firstChild){for(var o=0,i=0,a=!1,s=t.firstChild;s;s=s.nextSibling)1==s.nodeType?a=!0:3==s.nodeType&&s.nodeValue.match(/[^ \f\n\r\t\v]/)?o++:4==s.nodeType&&i++;if(a)if(o<2&&i<2){n.removeWhite(t);for(s=t.firstChild;s;s=s.nextSibling)3==s.nodeType?e["#text"]=n.escape(s.nodeValue):4==s.nodeType?e["#cdata"]=n.escape(s.nodeValue):e[s.nodeName]?e[s.nodeName]instanceof Array?e[s.nodeName][e[s.nodeName].length]=n.toObj(s):e[s.nodeName]=[e[s.nodeName],n.toObj(s)]:e[s.nodeName]=n.toObj(s)}else t.attributes.length?e["#text"]=n.escape(n.innerXml(t)):e=n.escape(n.innerXml(t));else if(o)t.attributes.length?e["#text"]=n.escape(n.innerXml(t)):e=n.escape(n.innerXml(t));else if(i)if(i>1)e=n.escape(n.innerXml(t));else for(s=t.firstChild;s;s=s.nextSibling)e["#cdata"]=n.escape(s.nodeValue)}t.attributes.length||t.firstChild||(e=null)}else 9==t.nodeType&&(e=n.toObj(t.documentElement));return e},toJson:function(t,e,r){var o=e?'"'+e+'"':"";if(t instanceof Array){for(var i=0,a=t.length;i<a;i++)t[i]=n.toJson(t[i],"",r+"\t");o+=(e?":[":"[")+(t.length>1?"\n"+r+"\t"+t.join(",\n"+r+"\t")+"\n"+r:t.join(""))+"]"}else if(null==t)o+=(e&&":")+"null";else if("object"==typeof t){var s=[];for(var c in t)s[s.length]=n.toJson(t[c],c,r+"\t");o+=(e?":{":"{")+(s.length>1?"\n"+r+"\t"+s.join(",\n"+r+"\t")+"\n"+r:s.join(""))+"}"}else o+="string"==typeof t?(e&&":")+'"'+t.toString()+'"':(e&&":")+t.toString();return o},innerXml:function(t){var e="";if("innerHTML"in t)e=t.innerHTML;else for(var n=function(t){var e="";if(1==t.nodeType){e+="<"+t.nodeName;for(var r=0;r<t.attributes.length;r++)e+=" "+t.attributes[r].nodeName+'="'+(t.attributes[r].nodeValue||"").toString()+'"';if(t.firstChild){e+=">";for(var o=t.firstChild;o;o=o.nextSibling)e+=n(o);e+="</"+t.nodeName+">"}else e+="/>"}else 3==t.nodeType?e+=t.nodeValue:4==t.nodeType&&(e+="<![CDATA["+t.nodeValue+"]]>");return e},r=t.firstChild;r;r=r.nextSibling)e+=n(r);return e},escape:function(t){return t.replace(/[\\]/g,"\\\\").replace(/[\"]/g,'\\"').replace(/[\n]/g,"\\n").replace(/[\r]/g,"\\r")},removeWhite:function(t){t.normalize();for(var e=t.firstChild;e;)if(3==e.nodeType)if(e.nodeValue.match(/[^ \f\n\r\t\v]/))e=e.nextSibling;else{var r=e.nextSibling;t.removeChild(e),e=r}else 1==e.nodeType?(n.removeWhite(e),e=e.nextSibling):e=e.nextSibling;return t}};return t=(new window.DOMParser).parseFromString(t,"text/xml"),n.toObj(n.removeWhite(t))};var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},requirejs,require,define;function getDefaultExportFromCjs(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function createCommonjsModule(t){var e={exports:{}};return t(e,e.exports),e.exports
|
|
2
2
|
/** vim: et:ts=4:sw=4:sts=4
|
|
3
3
|
* @license RequireJS 2.3.7 Copyright jQuery Foundation and other contributors.
|
|
4
4
|
* Released under MIT license, https://github.com/requirejs/requirejs/blob/master/LICENSE
|
|
@@ -6,4 +6,4 @@ System.register(["@enablerr-ui/form","@enablerr-ui/layout","@enablerr-ui/auth","
|
|
|
6
6
|
/*!
|
|
7
7
|
* Signature Pad v5.0.9 | https://github.com/szimek/signature_pad
|
|
8
8
|
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
9
|
-
*/class Point{constructor(t,e,n,r){if(isNaN(t)||isNaN(e))throw new Error(`Point is invalid: (${t}, ${e})`);this.x=+t,this.y=+e,this.pressure=n||0,this.time=r||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class Bezier{static fromPoints(t,e){const n=this.calculateControlPoints(t[0],t[1],t[2]).c2,r=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new Bezier(t[1],n,r,t[2],e.start,e.end)}static calculateControlPoints(t,e,n){const r=t.x-e.x,o=t.y-e.y,i=e.x-n.x,a=e.y-n.y,s=(t.x+e.x)/2,c=(t.y+e.y)/2,l=(e.x+n.x)/2,d=(e.y+n.y)/2,u=Math.sqrt(r*r+o*o),h=Math.sqrt(i*i+a*a),m=u+h==0?0:h/(u+h),f=l+(s-l)*m,p=d+(c-d)*m,_=e.x-f,g=e.y-p;return{c1:new Point(s+_,c+g),c2:new Point(l+_,d+g)}}constructor(t,e,n,r,o,i){this.startPoint=t,this.control2=e,this.control1=n,this.endPoint=r,this.startWidth=o,this.endWidth=i}length(){let t,e,n=0;for(let r=0;r<=10;r+=1){const o=r/10,i=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){const r=i-t,o=a-e;n+=Math.sqrt(r*r+o*o)}t=i,e=a}return n}point(t,e,n,r,o){return e*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*r*(1-t)*t*t+o*t*t*t}}class SignatureEventTarget{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,e,n){this._et.addEventListener(t,e,n)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,e,n){this._et.removeEventListener(t,e,n)}}function throttle(t,e=250){let n,r,o,i=0,a=null;const s=()=>{i=Date.now(),a=null,n=t.apply(r,o),a||(r=null,o=[])};return function(...c){const l=Date.now(),d=e-(l-i);return r=this,o=c,d<=0||d>e?(a&&(clearTimeout(a),a=null),i=l,n=t.apply(r,o),a||(r=null,o=[])):a||(a=window.setTimeout(s,d)),n}}class SignaturePad extends SignatureEventTarget{constructor(t,e={}){var n,r,o;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=t=>{this._isLeftButtonPressed(t,!0)&&!this._drawingStroke&&this._strokeBegin(this._pointerEventToSignatureEvent(t))},this._handleMouseMove=t=>{this._isLeftButtonPressed(t,!0)&&this._drawingStroke?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t)):this._strokeEnd(this._pointerEventToSignatureEvent(t),!1)},this._handleMouseUp=t=>{this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))},this._handleTouchStart=t=>{1!==t.targetTouches.length||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))},this._handleTouchMove=t=>{1===t.targetTouches.length&&(t.cancelable&&t.preventDefault(),this._drawingStroke?this._strokeMoveUpdate(this._touchEventToSignatureEvent(t)):this._strokeEnd(this._touchEventToSignatureEvent(t),!1))},this._handleTouchEnd=t=>{0===t.targetTouches.length&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))},this._handlePointerDown=t=>{!t.isPrimary||!this._isLeftButtonPressed(t)||this._drawingStroke||void 0!==this._strokePointerId&&this._strokePointerId!==this._getPointerId(t)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))},this._handlePointerMove=t=>{t.isPrimary&&this._strokePointerId===this._getPointerId(t)&&(this._isLeftButtonPressed(t,!0)&&this._drawingStroke?(t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))):this._strokeEnd(this._pointerEventToSignatureEvent(t),!1))},this._handlePointerUp=t=>{t.isPrimary&&!this._isLeftButtonPressed(t)&&this._strokePointerId===this._getPointerId(t)&&(this._strokePointerId=void 0,t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))},this.velocityFilterWeight=e.velocityFilterWeight||.7,this.minWidth=e.minWidth||.5,this.maxWidth=e.maxWidth||2.5,this.throttle=null!==(n=e.throttle)&&void 0!==n?n:16,this.minDistance=null!==(r=e.minDistance)&&void 0!==r?r:5,this.dotSize=e.dotSize||0,this.penColor=e.penColor||"black",this.backgroundColor=e.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=e.compositeOperation||"source-over",this.canvasContextOptions=null!==(o=e.canvasContextOptions)&&void 0!==o?o:{},this._strokeMoveUpdate=this.throttle?throttle(SignaturePad.prototype._strokeUpdate,this.throttle):SignaturePad.prototype._strokeUpdate,this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:e}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}fromDataURL(t,e={}){return new Promise((n,r)=>{const o=new Image,i=e.ratio||window.devicePixelRatio||1,a=e.width||this.canvas.width/i,s=e.height||this.canvas.height/i,c=e.xOffset||0,l=e.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,c,l,a,s),n()},o.onerror=t=>{r(t)},o.crossOrigin="anonymous",o.src=t,this._isEmpty=!1})}toDataURL(t="image/png",e){return"image/svg+xml"===t?("object"!=typeof e&&(e=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(e))}`):("number"!=typeof e&&(e=void 0),this.canvas.toDataURL(t,e))}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const e=window.document===this.canvas.ownerDocument?window:null!==(t=this.canvas.ownerDocument.defaultView)&&void 0!==t?t:this.canvas.ownerDocument;return{addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:e=!0}={}){e&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,e){return e?1===t.buttons:!(1&~t.buttons)}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const e=t.changedTouches[0];return{event:t,type:t.type,x:e.clientX,y:e.clientY,pressure:e.force}}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:e}=this._getListenerFunctions();switch(t.event.type){case"mousedown":e("mousemove",this._handleMouseMove,{passive:!1}),e("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":e("touchmove",this._handleTouchMove,{passive:!1}),e("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":e("pointermove",this._handlePointerMove,{passive:!1}),e("pointerup",this._handlePointerUp,{passive:!1})}this._drawingStroke=!0;const n=this._getPointGroupOptions(),r=Object.assign(Object.assign({},n),{points:[]});this._data.push(r),this._reset(n),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(t);this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const e=this._createPoint(t.x,t.y,t.pressure),n=this._data[this._data.length-1],r=n.points,o=r.length>0&&r[r.length-1],i=!!o&&e.distanceTo(o)<=this.minDistance,a=this._getPointGroupOptions(n);if(!o||!o||!i){const t=this._addPoint(e,a);o?t&&this._drawCurve(t,a):this._drawDot(e,a),r.push({time:e.time,x:e.x,y:e.y,pressure:e.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,e=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(e&&this._strokeUpdate(t),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,e,n){const r=this.canvas.getBoundingClientRect();return new Point(t-r.left,e-r.top,n,(new Date).getTime())}_addPoint(t,e){const{_lastPoints:n}=this;if(n.push(t),n.length>2){3===n.length&&n.unshift(n[0]);const t=this._calculateCurveWidths(n[1],n[2],e),r=Bezier.fromPoints(n,t);return n.shift(),r}return null}_calculateCurveWidths(t,e,n){const r=n.velocityFilterWeight*e.velocityFrom(t)+(1-n.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(r,n),i={end:o,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=o,i}_strokeWidth(t,e){return Math.max(e.maxWidth/(t+1),e.minWidth)}_drawCurveSegment(t,e,n){const r=this._ctx;r.moveTo(t,e),r.arc(t,e,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,e){const n=this._ctx,r=t.endWidth-t.startWidth,o=2*Math.ceil(t.length());n.beginPath(),n.fillStyle=e.penColor;for(let n=0;n<o;n+=1){const i=n/o,a=i*i,s=a*i,c=1-i,l=c*c,d=l*c;let u=d*t.startPoint.x;u+=3*l*i*t.control1.x,u+=3*c*a*t.control2.x,u+=s*t.endPoint.x;let h=d*t.startPoint.y;h+=3*l*i*t.control1.y,h+=3*c*a*t.control2.y,h+=s*t.endPoint.y;const m=Math.min(t.startWidth+s*r,e.maxWidth);this._drawCurveSegment(u,h,m)}n.closePath(),n.fill()}_drawDot(t,e){const n=this._ctx,r=e.dotSize>0?e.dotSize:(e.minWidth+e.maxWidth)/2;n.beginPath(),this._drawCurveSegment(t.x,t.y,r),n.closePath(),n.fillStyle=e.penColor,n.fill()}_fromData(t,e,n){for(const r of t){const{points:t}=r,o=this._getPointGroupOptions(r);if(t.length>1)for(let n=0;n<t.length;n+=1){const r=t[n],i=new Point(r.x,r.y,r.pressure,r.time);0===n&&this._reset(o);const a=this._addPoint(i,o);a&&e(a,o)}else this._reset(o),n(t[0],o)}}toSVG({includeBackgroundColor:t=!1}={}){const e=this._data,n=Math.max(window.devicePixelRatio||1,1),r=this.canvas.width/n,o=this.canvas.height/n,i=document.createElementNS("http://www.w3.org/2000/svg","svg");if(i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),i.setAttribute("viewBox",`0 0 ${r} ${o}`),i.setAttribute("width",r.toString()),i.setAttribute("height",o.toString()),t&&this.backgroundColor){const t=document.createElement("rect");t.setAttribute("width","100%"),t.setAttribute("height","100%"),t.setAttribute("fill",this.backgroundColor),i.appendChild(t)}return this._fromData(e,(t,{penColor:e})=>{const n=document.createElement("path");if(!(isNaN(t.control1.x)||isNaN(t.control1.y)||isNaN(t.control2.x)||isNaN(t.control2.y))){const r=`M ${t.startPoint.x.toFixed(3)},${t.startPoint.y.toFixed(3)} C ${t.control1.x.toFixed(3)},${t.control1.y.toFixed(3)} ${t.control2.x.toFixed(3)},${t.control2.y.toFixed(3)} ${t.endPoint.x.toFixed(3)},${t.endPoint.y.toFixed(3)}`;n.setAttribute("d",r),n.setAttribute("stroke-width",(2.25*t.endWidth).toFixed(3)),n.setAttribute("stroke",e),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),i.appendChild(n)}},(t,{penColor:e,dotSize:n,minWidth:r,maxWidth:o})=>{const a=document.createElement("circle"),s=n>0?n:(r+o)/2;a.setAttribute("r",s.toString()),a.setAttribute("cx",t.x.toString()),a.setAttribute("cy",t.y.toString()),a.setAttribute("fill",e),i.appendChild(a)}),i.outerHTML}}const{document:document_1$2}=globals;function add_css$6(){var t=element("style");t.id="svelte-efkzkz-style",t.textContent=".feather2.svelte-efkzkz{position:absolute;top:0.25em;right:0.25em;color:#4300b0}.wrapper.svelte-efkzkz{position:relative;width:100%;height:200px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #36697d}canvas.svelte-efkzkz{width:100%;height:100%;display:block;background-color:lightyellow}.signature-readonly.svelte-efkzkz{cursor:not-allowed;pointer-events:none}",append(document_1$2.head,t)}function create_if_block$6(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 pointer svelte-efkzkz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[5]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$7(t){let e,n,r,o,i,a,s=!t[0]&&create_if_block$6(t);return{c(){e=element("div"),n=element("canvas"),o=space(),s&&s.c(),attr(n,"id",t[1]),attr(n,"name",t[1]),attr(n,"class",r=t[2]+" signature_pad "+t[3]+(t[0]||t[4]?" signature-readonly":"")+" svelte-efkzkz"),attr(e,"class",i=t[2]+"_wrapper wrapper svelte-efkzkz"),attr(e,"id","signature_wrapper")},m(t,r){insert(t,e,r),append(e,n),append(e,o),s&&s.m(e,null),a=!0},p(t,[o]){(!a||2&o)&&attr(n,"id",t[1]),(!a||2&o)&&attr(n,"name",t[1]),(!a||29&o&&r!==(r=t[2]+" signature_pad "+t[3]+(t[0]||t[4]?" signature-readonly":"")+" svelte-efkzkz"))&&attr(n,"class",r),t[0]?s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()):s?(s.p(t,o),1&o&&transition_in(s,1)):(s=create_if_block$6(t),s.c(),transition_in(s,1),s.m(e,null)),(!a||4&o&&i!==(i=t[2]+"_wrapper wrapper svelte-efkzkz"))&&attr(e,"class",i)},i(t){a||(transition_in(s),a=!0)},o(t){transition_out(s),a=!1},d(t){t&&detach(e),s&&s.d()}}}const signatureMap=new Map;let signature="";function instance$7(t,e,n){const r=createEventDispatcher();let o,{id:i}=e,{name:a}=e,{value:s}=e,{record:c}=e,{classId:l}=e,{disabled:d}=e,{readonly:u}=e;const h=c._id||Math.floor(9e3*Math.random()+1e3).toString();u||=d;const m=t=>{signature=t,signatureMap.set(h,signature),r("blur",{value:signature})};return onMount(()=>{signature=s||signatureMap.get(h)||"",signatureMap.set(h,signature);const t=document.querySelector("canvas");n(8,o=new SignaturePad(t)),u||(o.addEventListener("endStroke",()=>{m(o.toDataURL("image/png"))}),o.addEventListener("afterUpdateStroke",()=>{m(o.toDataURL("image/png"))}))}),onDestroy(()=>signatureMap.forEach((t,e,n)=>{e!==h&&n.delete(e)})),t.$$set=t=>{"id"in t&&n(1,i=t.id),"name"in t&&n(2,a=t.name),"value"in t&&n(6,s=t.value),"record"in t&&n(7,c=t.record),"classId"in t&&n(3,l=t.classId),"disabled"in t&&n(4,d=t.disabled),"readonly"in t&&n(0,u=t.readonly)},t.$$.update=()=>{256&t.$$.dirty&&signature&&o&&o.fromDataURL(signature,{ratio:1})},[u,i,a,l,d,()=>{o.clear(),m("")},s,c,o]}class InputSignature extends SvelteComponent{constructor(t){super(),document_1$2.getElementById("svelte-efkzkz-style")||add_css$6(),init(this,t,instance$7,create_fragment$7,safe_not_equal,{id:1,name:2,value:6,record:7,classId:3,disabled:4,readonly:0})}}function add_css$5(){var t=element("style");t.id="svelte-bcd9jd-style",t.textContent=".feather.svelte-bcd9jd.svelte-bcd9jd{position:absolute;top:0.75em;left:0.5em;color:#326173}.feather2.svelte-bcd9jd.svelte-bcd9jd{position:absolute;top:0.75em;left:0.5em;color:light-gray}.eList.svelte-bcd9jd.svelte-bcd9jd{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-bcd9jd table.svelte-bcd9jd{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-bcd9jd table thead.svelte-bcd9jd{position:sticky;top:0;background:#326173;color:white}.eList.svelte-bcd9jd table thead tr.svelte-bcd9jd{height:2.3em}.eList.svelte-bcd9jd table tbody tr.svelte-bcd9jd{height:2.75em !important}th.svelte-bcd9jd.svelte-bcd9jd,td.svelte-bcd9jd.svelte-bcd9jd{padding-left:0.4em;padding-right:0.4em}",append(document.head,t)}function get_each_context$3(t,e,n){const r=t.slice();return r[36]=e[n],r[38]=n,r}function create_else_block_1$3(t){let e,n,r;return n=new BookOpenIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-bcd9jd"),attr(e,"title",t[21])},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block_2$3(t){let e,n,r,o,i;return n=new BookOpenIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-bcd9jd"),attr(e,"title",t[21])},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[22]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block$5(t){let e,n,r;function o(e){t[28](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$4]},$$scope:{ctx:t}};return void 0!==t[8]&&(i.open=t[8]),e=new t[12]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};1536&r[0]|256&r[1]&&(o.$$scope={dirty:r,ctx:t}),!n&&256&r[0]&&(n=!0,o.open=t[8],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$2(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_else_block$4(t){let e,n,r,o=(t[10]||"Keine Einträge gefunden!")+"";return{c(){e=element("tr"),n=element("td"),r=text(o),attr(n,"class","svelte-bcd9jd"),attr(e,"class","svelte-bcd9jd")},m(t,o){insert(t,e,o),append(e,n),append(n,r)},p(t,e){1024&e[0]&&o!==(o=(t[10]||"Keine Einträge gefunden!")+"")&&set_data(r,o)},d(t){t&&detach(e)}}}function create_if_block_1$4(t){let e,n=t[9],r=[];for(let e=0;e<n.length;e+=1)r[e]=create_each_block$3(get_each_context$3(t,n,e));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,n){for(let e=0;e<r.length;e+=1)r[e].m(t,n);insert(t,e,n)},p(t,o){if(25166336&o[0]){let i;for(n=t[9],i=0;i<n.length;i+=1){const a=get_each_context$3(t,n,i);r[i]?r[i].p(a,o):(r[i]=create_each_block$3(a),r[i].c(),r[i].m(e.parentNode,e))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){destroy_each(r,t),t&&detach(e)}}}function create_each_block$3(t){let e,n,r,o,i,a,s=t[23](t[36])+"";return{c(){e=element("tr"),n=element("td"),r=text(s),o=space(),attr(n,"class","svelte-bcd9jd"),attr(e,"class","pointer svelte-bcd9jd")},m(s,c){insert(s,e,c),append(e,n),append(n,r),append(e,o),i||(a=listen(e,"click",stop_propagation(t[24](t[38]))),i=!0)},p(e,n){t=e,512&n[0]&&s!==(s=t[23](t[36])+"")&&set_data(r,s)},d(t){t&&detach(e),i=!1,a()}}}function create_default_slot_1$3(t){let e,n,r,o,i,a,s,c,l,d,u,h,m;function f(t,e){return t[9]?.length?create_if_block_1$4:create_else_block$4}n=new t[14]({props:{outline:!0,$$slots:{default:[create_default_slot_2$2]},$$scope:{ctx:t}}}),n.$on("click",t[25]),o=new t[15]({});let p=f(t),_=p(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),create_component(o.$$.fragment),i=space(),a=element("div"),s=element("table"),c=element("thead"),l=element("tr"),d=element("th"),d.textContent=`${t[20]}`,u=space(),h=element("tbody"),_.c(),attr(d,"class","svelte-bcd9jd"),attr(l,"class","svelte-bcd9jd"),attr(c,"class","svelte-bcd9jd"),attr(s,"striped",""),attr(s,"class","svelte-bcd9jd"),attr(a,"class","eList svelte-bcd9jd")},m(t,f){insert(t,e,f),mount_component(n,e,null),insert(t,r,f),mount_component(o,t,f),insert(t,i,f),insert(t,a,f),append(a,s),append(s,c),append(c,l),append(l,d),append(s,u),append(s,h),_.m(h,null),m=!0},p(t,e){const r={};256&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r),p===(p=f(t))&&_?_.p(t,e):(_.d(1),_=p(t),_&&(_.c(),_.m(h,null)))},i(t){m||(transition_in(n.$$.fragment,t),transition_in(o.$$.fragment,t),m=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(o.$$.fragment,t),m=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),destroy_component(o,t),t&&detach(i),t&&detach(a),_.d()}}}function create_default_slot$4(t){let e,n;return e=new t[13]({props:{title:t[21],class:"eList",$$slots:{default:[create_default_slot_1$3]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1536&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$6(t){let e,n,r,o,i,a,s,c,l;function d(e){t[26](e)}let u={id:t[2],name:t[3].name,inputClass:t[5]||t[1],disabled:t[6],formnovalidate:t[7],readonly:t[18],pattern:t[17],required:t[19],style:"padding-left:2em;"};void 0!==t[0]&&(u.value=t[0]),n=new t[11]({props:u}),binding_callbacks.push(()=>bind(n,"value",d)),n.$on("change",t[27]);const h=[create_if_block_2$3,create_else_block_1$3],m=[];function f(t,e){return t[6]||t[4]._id?1:0}i=f(t),a=m[i]=h[i](t);let p=t[8]&&create_if_block$5(t);return{c(){e=element("div"),create_component(n.$$.fragment),o=space(),a.c(),s=space(),p&&p.c(),c=empty(),set_style(e,"position","relative")},m(t,r){insert(t,e,r),mount_component(n,e,null),append(e,o),m[i].m(e,null),insert(t,s,r),p&&p.m(t,r),insert(t,c,r),l=!0},p(t,o){const s={};4&o[0]&&(s.id=t[2]),8&o[0]&&(s.name=t[3].name),34&o[0]&&(s.inputClass=t[5]||t[1]),64&o[0]&&(s.disabled=t[6]),128&o[0]&&(s.formnovalidate=t[7]),!r&&1&o[0]&&(r=!0,s.value=t[0],add_flush_callback(()=>r=!1)),n.$set(s);let l=i;i=f(t),i===l?m[i].p(t,o):(group_outros(),transition_out(m[l],1,1,()=>{m[l]=null}),check_outros(),a=m[i],a?a.p(t,o):(a=m[i]=h[i](t),a.c()),transition_in(a,1),a.m(e,null)),t[8]?p?(p.p(t,o),256&o[0]&&transition_in(p,1)):(p=create_if_block$5(t),p.c(),transition_in(p,1),p.m(c.parentNode,c)):p&&(group_outros(),transition_out(p,1,1,()=>{p=null}),check_outros())},i(t){l||(transition_in(n.$$.fragment,t),transition_in(a),transition_in(p),l=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a),transition_out(p),l=!1},d(t){t&&detach(e),destroy_component(n),m[i].d(),t&&detach(s),p&&p.d(t),t&&detach(c)}}}function instance$6(t,e,n){let r;const{TextField:o,Modal:i,Dialog:a,Button:s,Divider:c}=getAttractions,l=createEventDispatcher(),{environment:d}=user;component_subscribe(t,d,t=>n(29,r=t));let{classId:u}=e,{id:h}=e,{item:m}=e,{record:f={}}=e,{value:p}=e,{noForm:_=!1}=e,{disabled:g}=e,{formnovalidate:w}=e;const{properties:$={}}=m;let{pattern:y,placeholder:b,readonly:v,required:I=!1,format:C}=$,E=!1;const{service:{type:A,map:S,title:k,designation:T}}=C;let R,N;const D=()=>{n(8,E=!1)};return t.$$set=t=>{"classId"in t&&n(1,u=t.classId),"id"in t&&n(2,h=t.id),"item"in t&&n(3,m=t.item),"record"in t&&n(4,f=t.record),"value"in t&&n(0,p=t.value),"noForm"in t&&n(5,_=t.noForm),"disabled"in t&&n(6,g=t.disabled),"formnovalidate"in t&&n(7,w=t.formnovalidate)},[p,u,h,m,f,_,g,w,E,R,N,o,i,a,s,c,d,y,v,I,k,T,async()=>{g||f._id||(n(9,R=[]),n(10,N=""),p.length>3&&(n(9,R=await Request.getService("address",A,p)),Array.isArray(R)||n(10,N=R.error)),n(8,E=!0))},t=>S.map(({name:e})=>t[e]).filter(t=>!!t).join(", "),t=>()=>{const e=R[t],n=[];let o="";for(const{name:t,refItem:i}of S){const[a,s]=i.split(".");s?(o=a,"owner.country"===t&&(e[t]=r.country?._id||""),n.push({name:s,value:e[t]})):l("record",{itemName:i,value:e[t]})}n.length&&l("objRecord",{listName:o,items:n}),D()},D,function(t){p=t,n(0,p)},function(e){bubble(t,e)},function(t){E=t,n(8,E)}]}class InputService extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-bcd9jd-style")||add_css$5(),init(this,t,instance$6,create_fragment$6,safe_not_equal,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7},[-1,-1])}}function add_css$4(){var t=element("style");t.id="svelte-1xgbysl-style",t.textContent=".feather.svelte-1xgbysl{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-1xgbysl{position:absolute;top:0.75em;left:0.5em;color:light-gray}",append(document.head,t)}function create_else_block$3(t){let e,n,r;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-1xgbysl")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block$4(t){let e,n,r,o,i;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-1xgbysl")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[6]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$5(t){let e,n,r,o,i,a;n=new t[5]({props:{inputClass:t[0],disabled:!0,formnovalidate:t[1],readonly:!0,id:t[2],name:t[3],value:t[4],style:"padding-left: 2em;"}});const s=[create_if_block$4,create_else_block$3],c=[];function l(t,e){return t[4]?0:1}return o=l(t),i=c[o]=s[o](t),{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i.c(),set_style(e,"position","relative")},m(t,i){insert(t,e,i),mount_component(n,e,null),append(e,r),c[o].m(e,null),a=!0},p(t,[r]){const a={};1&r&&(a.inputClass=t[0]),2&r&&(a.formnovalidate=t[1]),4&r&&(a.id=t[2]),8&r&&(a.name=t[3]),16&r&&(a.value=t[4]),n.$set(a);let d=o;o=l(t),o===d?c[o].p(t,r):(group_outros(),transition_out(c[d],1,1,()=>{c[d]=null}),check_outros(),i=c[o],i?i.p(t,r):(i=c[o]=s[o](t),i.c()),transition_in(i,1),i.m(e,null))},i(t){a||(transition_in(n.$$.fragment,t),transition_in(i),a=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),a=!1},d(t){t&&detach(e),destroy_component(n),c[o].d()}}}function instance$5(t,e,n){const{TextField:r}=getAttractions;let{inputClass:o}=e,{disabled:i}=e,{formnovalidate:a}=e,{readonly:s}=e,{required:c}=e,{id:l}=e,{name:d}=e,{value:u}=e,{record:h}=e;const m=h?.task;return t.$$set=t=>{"inputClass"in t&&n(0,o=t.inputClass),"disabled"in t&&n(7,i=t.disabled),"formnovalidate"in t&&n(1,a=t.formnovalidate),"readonly"in t&&n(8,s=t.readonly),"required"in t&&n(9,c=t.required),"id"in t&&n(2,l=t.id),"name"in t&&n(3,d=t.name),"value"in t&&n(4,u=t.value),"record"in t&&n(10,h=t.record)},[o,a,l,d,u,r,async()=>{m&&window.open(m)},i,s,c,h]}class InputTask extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-1xgbysl-style")||add_css$4(),init(this,t,instance$5,create_fragment$5,safe_not_equal,{inputClass:0,disabled:7,formnovalidate:1,readonly:8,required:9,id:2,name:3,value:4,record:10})}}function add_css$3(){var t=element("style");t.id="svelte-rxh0vh-style",t.textContent=".form-field{margin-bottom:0.5em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em;color:black}.form-field div.field > label.checkbox{padding-top:0.5em}.form-field label.color_red{color:red}",append(document.head,t)}function create_else_block$2(t){let e,n;return e=new t[30]({props:{id:t[46](t[39]),class:t[0].name+(t[26]?" hidden ":""),nameClass:t[0].properties?.color?"color_"+t[0].properties.color:"",name:t[0].designation,help:t[0].properties?.hint,$$slots:{default:[create_default_slot_1$2,({notifyList:t})=>({24:t}),({notifyList:t})=>[t?16777216:0]]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};67108865&n[0]&&(r.class=t[0].name+(t[26]?" hidden ":"")),1&n[0]&&(r.nameClass=t[0].properties?.color?"color_"+t[0].properties.color:""),1&n[0]&&(r.name=t[0].designation),1&n[0]&&(r.help=t[0].properties?.hint),872415231&n[0]|262144&n[2]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_2$2(t){let e,n;return e=new t[33]({props:{text:t[0].designation}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[0]&&(r.text=t[0].designation),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_1$3(t){let e,n,r,o;return e=new t[30]({props:{id:t[46](t[39]),class:t[0].name+(t[26]?" hidden ":""),name:t[0].designation,help:t[0].properties?.hint}}),r=new InputRichtext({props:{classId:t[9],disabled:t[3],readonly:t[25],id:t[39],name:t[0].name,value:t[28](),record:t[1],noForm:t[8]}}),r.$on("blur",t[42]()),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};67108865&n[0]&&(o.class=t[0].name+(t[26]?" hidden ":"")),1&n[0]&&(o.name=t[0].designation),1&n[0]&&(o.help=t[0].properties?.hint),e.$set(o);const i={};512&n[0]&&(i.classId=t[9]),8&n[0]&&(i.disabled=t[3]),33554432&n[0]&&(i.readonly=t[25]),1&n[0]&&(i.name=t[0].name),268435456&n[0]&&(i.value=t[28]()),2&n[0]&&(i.record=t[1]),256&n[0]&&(i.noForm=t[8]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_if_block$3(t){let e,n,r,o,i,a;return e=new t[30]({props:{id:t[46](t[39]),class:t[0].name+" hidden",name:t[0].designation,help:t[0].properties?.hint,$$slots:{default:[create_default_slot$3]},$$scope:{ctx:t}}}),r=new t[33]({props:{text:t[29]}}),i=new InputObjectReference({props:{required:t[4],disabled:t[3],readonly:t[25],id:t[39],item:t[0],currency:t[19],value:t[28]()}}),i.$on("setRefValue",t[47]),i.$on("safeReference",t[52]),i.$on("objRecord",t[53]),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment),o=space(),create_component(i.$$.fragment)},m(t,s){mount_component(e,t,s),insert(t,n,s),mount_component(r,t,s),insert(t,o,s),mount_component(i,t,s),a=!0},p(t,n){const o={};1&n[0]&&(o.class=t[0].name+" hidden"),1&n[0]&&(o.name=t[0].designation),1&n[0]&&(o.help=t[0].properties?.hint),402654721&n[0]|262144&n[2]&&(o.$$scope={dirty:n,ctx:t}),e.$set(o);const a={};536870912&n[0]&&(a.text=t[29]),r.$set(a);const s={};16&n[0]&&(s.required=t[4]),8&n[0]&&(s.disabled=t[3]),33554432&n[0]&&(s.readonly=t[25]),1&n[0]&&(s.item=t[0]),524288&n[0]&&(s.currency=t[19]),268435456&n[0]&&(s.value=t[28]()),i.$set(s)},i(t){a||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),transition_in(i.$$.fragment,t),a=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),transition_out(i.$$.fragment,t),a=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t),t&&detach(o),destroy_component(i,t)}}}function create_else_block_1$2(t){let e,n;return e=new t[31]({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],pattern:t[35],required:!0===t[4],placeholder:t[37],id:t[39],name:t[38],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=!0===t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_26(t){let e,n;return e=new InputTel({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],pattern:t[35],placeholder:t[37],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_25(t){let e,n;return e=new InputTask({props:{inputClass:t[8]||t[9],formnovalidate:t[12],id:t[39],name:t[38],value:t[28](),record:t[1],"}":!0}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),4096&n[0]&&(r.formnovalidate=t[12]),268435456&n[0]&&(r.value=t[28]()),2&n[0]&&(r.record=t[1]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_24(t){let e,n;return e=new InputUrl({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_23$1(t){let e,n;return e=new InputMail({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],pattern:t[35],multiple:t[36],placeholder:t[37],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_22$1(t){let e,n;return e=new InputTime({props:{inputClass:t[8]||t[9],disabled:t[3],readonly:t[25],required:t[4],id:t[39],item:t[0],value:t[28](),praefix:t[5]}}),e.$on("blur",t[42]()),e.$on("checkRange",t[71]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),268435456&n[0]&&(r.value=t[28]()),32&n[0]&&(r.praefix=t[5]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_21$1(t){let e,n;return e=new InputMap({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],value:t[28](),record:t[1],item:t[0]}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),2&n[0]&&(r.record=t[1]),1&n[0]&&(r.item=t[0]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_20$1(t){let e,n;return e=new InputDateTime({props:{classId:t[9],id:t[39],disabled:t[3],required:t[4],value:t[40](),noForm:t[8]}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_19$1(t){let e,n;return e=new InputDateRange({props:{classId:t[9],id:t[39],item:t[0],disabled:t[3],required:t[4],value:t[41](),noForm:t[8]}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1&n[0]&&(r.item=t[0]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_18$1(t){let e,n;return e=new InputDate({props:{classId:t[9],eventId:t[10],id:t[39],item:t[0],record:t[1],readonly:t[25],disabled:t[3],required:t[4],praefix:t[5],value:t[40](),noForm:t[8],notifyList:t[24],dateInput:t[23]}}),e.$on("change",t[42](!0)),e.$on("formula",t[69]),e.$on("record",t[70]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),33554432&n[0]&&(r.readonly=t[25]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),32&n[0]&&(r.praefix=t[5]),256&n[0]&&(r.noForm=t[8]),16777216&n[0]&&(r.notifyList=t[24]),8388608&n[0]&&(r.dateInput=t[23]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_17$1(t){let e,n;return e=new t[32]({props:{round:!0,inputClass:t[8]||t[9],disabled:t[3]||t[25],required:t[4],id:t[39],name:t[38],checked:t[28](),value:t[28](!0)}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),33554440&n[0]&&(r.disabled=t[3]||t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.checked=t[28]()),268435456&n[0]&&(r.value=t[28](!0)),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_16$1(t){let e,n;return e=new InputLookup({props:{id:t[39],item:t[0],praefix:t[5],record:t[1],notifyList:t[24]}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[0]&&(r.item=t[0]),32&n[0]&&(r.praefix=t[5]),2&n[0]&&(r.record=t[1]),16777216&n[0]&&(r.notifyList=t[24]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_15$1(t){let e,n;return e=new InputAutocomplete({props:{classId:t[9],item:t[0],record:t[1],listName:t[6],disabled:t[3],formnovalidate:t[12],readonly:t[25],pattern:t[35],required:!0===t[4],placeholder:t[37],id:t[39],name:t[38],value:t[28]()}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),64&n[0]&&(r.listName=t[6]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=!0===t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_14$2(t){let e,n;return e=new InputView({props:{classId:t[9],disabled:t[3],required:t[4],id:t[39],item:t[0],record:t[1],value:t[28](),noForm:t[8],view:t[0].properties.view,praefix:t[5]}}),e.$on("blur",t[42]()),e.$on("invalid",t[68]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.view=t[0].properties.view),32&n[0]&&(r.praefix=t[5]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_13$2(t){let e,n;return e=new InputMulti({props:{classId:t[9],disabled:t[3],required:t[4],id:t[39],item:t[0],record:t[1],value:t[28](),noForm:t[8],multi:t[0].properties.multi,numberInput:t[14],praefix:t[5],toDelete:t[17],reqQuantity:t[18],notifyList:t[24]}}),e.$on("blur",t[42]()),e.$on("invalid",t[67]),e.$on("record",t[43]),e.$on("multi",t[44]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.multi=t[0].properties.multi),16384&n[0]&&(r.numberInput=t[14]),32&n[0]&&(r.praefix=t[5]),131072&n[0]&&(r.toDelete=t[17]),262144&n[0]&&(r.reqQuantity=t[18]),16777216&n[0]&&(r.notifyList=t[24]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_12$2(t){let e,n;return e=new InputNumber({props:{classId:t[9],disabled:t[3],formnovalidate:t[12],required:t[4],readonly:t[25],id:t[39],item:t[0],currency:t[19],value:t[28](),praefix:t[5],notifyList:t[24],noForm:t[8]}}),e.$on("blur",t[42]()),e.$on("formula",t[64]),e.$on("listRecord",t[65]),e.$on("record",t[66]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),16&n[0]&&(r.required=t[4]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),524288&n[0]&&(r.currency=t[19]),268435456&n[0]&&(r.value=t[28]()),32&n[0]&&(r.praefix=t[5]),16777216&n[0]&&(r.notifyList=t[24]),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_11$2(t){let e,n;return e=new InputService({props:{classId:t[9],disabled:t[3],readonly:t[25],required:t[4],id:t[39],item:t[0],record:t[1],value:t[28](),noForm:t[8]}}),e.$on("change",t[42]()),e.$on("record",t[62]),e.$on("objRecord",t[63]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_10$2(t){let e,n;return e=new InputSelect({props:{classId:t[9],disabled:t[3],required:t[4],id:t[39],item:t[0],value:t[28](),noForm:t[8]}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_9$2(t){let e,n;return e=new InputSignature({props:{classId:t[9],disabled:t[3],readonly:t[25],id:t[39],name:t[0].name,value:t[28](),record:t[1],noForm:t[8],placeholder:t[0].properties?.placeholder}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.name=t[0].name),268435456&n[0]&&(r.value=t[28]()),2&n[0]&&(r.record=t[1]),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.placeholder=t[0].properties?.placeholder),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_8$2(t){let e,n;return e=new InputFilePDF({props:{praefix:t[5],classId:t[9],disabled:t[3],readonly:t[25],item:t[0],id:t[39],name:t[0].name,eventId:t[10],record:t[1],recordId:t[2],value:t[28](),fileType:t[0].properties?.accept}}),e.$on("record",t[60]),e.$on("listRecord",t[61]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};32&n[0]&&(r.praefix=t[5]),512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),1&n[0]&&(r.name=t[0].name),1024&n[0]&&(r.eventId=t[10]),2&n[0]&&(r.record=t[1]),4&n[0]&&(r.recordId=t[2]),268435456&n[0]&&(r.value=t[28]()),1&n[0]&&(r.fileType=t[0].properties?.accept),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_7$2(t){let e,n;return e=new InputFileQR({props:{praefix:t[5],classId:t[9],disabled:t[3],readonly:t[25],item:t[0],id:t[39],name:t[0].name,eventId:t[10],record:t[1],value:t[28]()}}),e.$on("record",t[59]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};32&n[0]&&(r.praefix=t[5]),512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),1&n[0]&&(r.name=t[0].name),1024&n[0]&&(r.eventId=t[10]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_6$2(t){let e,n;return e=new InputFile({props:{classId:t[9],disabled:t[3],readonly:t[25],item:t[0],id:t[39],name:t[0].name,eventId:t[10],record:t[1],value:t[28]()}}),e.$on("record",t[58]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),1&n[0]&&(r.name=t[0].name),1024&n[0]&&(r.eventId=t[10]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_5$2(t){let e,n;return e=new TextArea({props:{classId:t[9],disabled:t[3],readonly:t[25],id:t[39],name:t[0].name,value:t[28](),noForm:t[8],standard:!0,style:"",placeholder:t[0].properties?.placeholder}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.name=t[0].name),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.placeholder=t[0].properties?.placeholder),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_4$2(t){let e,n;return e=new InputReference({props:{classId:t[9],eventId:t[10],fullRecord:t[7],required:t[4],disabled:t[3],formnovalidate:t[12],readonly:t[25],id:t[39],item:t[0],desc:t[29],value:t[28](),multiValues:t[20],noForm:t[8],praefix:t[5],selectionFields:t[11],selection:t[13],deList:t[15],recordId:t[2],isTemplate:t[16],shortEdit:t[21],initFinished:t[22]}}),e.$on("task",t[56]),e.$on("change",t[42]()),e.$on("initFail",t[45]),e.$on("defPrep",t[57]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),128&n[0]&&(r.fullRecord=t[7]),16&n[0]&&(r.required=t[4]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),536870912&n[0]&&(r.desc=t[29]),268435456&n[0]&&(r.value=t[28]()),1048576&n[0]&&(r.multiValues=t[20]),256&n[0]&&(r.noForm=t[8]),32&n[0]&&(r.praefix=t[5]),2048&n[0]&&(r.selectionFields=t[11]),8192&n[0]&&(r.selection=t[13]),32768&n[0]&&(r.deList=t[15]),4&n[0]&&(r.recordId=t[2]),65536&n[0]&&(r.isTemplate=t[16]),2097152&n[0]&&(r.shortEdit=t[21]),4194304&n[0]&&(r.initFinished=t[22]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_3$2(t){let e,n;return e=new InputReferenceMulti({props:{classId:t[9],eventId:t[10],required:t[4],disabled:t[3],formnovalidate:t[12],readonly:t[25],id:t[39],item:t[0],record:t[1],desc:t[29],values:t[28]()||[],noForm:t[8],praefix:t[5],selectionFields:t[11],selection:t[13],deList:t[15],recordId:t[2],isTemplate:t[16]}}),e.$on("task",t[54]),e.$on("change",t[42]()),e.$on("multi",t[44]),e.$on("initFail",t[45]),e.$on("defPrep",t[55]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),16&n[0]&&(r.required=t[4]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),536870912&n[0]&&(r.desc=t[29]),268435456&n[0]&&(r.values=t[28]()||[]),256&n[0]&&(r.noForm=t[8]),32&n[0]&&(r.praefix=t[5]),2048&n[0]&&(r.selectionFields=t[11]),8192&n[0]&&(r.selection=t[13]),32768&n[0]&&(r.deList=t[15]),4&n[0]&&(r.recordId=t[2]),65536&n[0]&&(r.isTemplate=t[16]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$2(t){let e,n,r,o;const i=[create_if_block_3$2,create_if_block_4$2,create_if_block_5$2,create_if_block_6$2,create_if_block_7$2,create_if_block_8$2,create_if_block_9$2,create_if_block_10$2,create_if_block_11$2,create_if_block_12$2,create_if_block_13$2,create_if_block_14$2,create_if_block_15$1,create_if_block_16$1,create_if_block_17$1,create_if_block_18$1,create_if_block_19$1,create_if_block_20$1,create_if_block_21$1,create_if_block_22$1,create_if_block_23$1,create_if_block_24,create_if_block_25,create_if_block_26,create_else_block_1$2],a=[];function s(t,e){return"object"===t[0].type&&t[0].properties?.multi?0:"object"===t[0].type?1:"textarea"===t[0].type||t[0].properties&&"textarea"===t[0].properties.format?2:"file"===t[0].type?3:"fileQR"===t[0].type?4:"filePDF"===t[0].type?5:"signature"===t[0].type?6:t[0].properties&&(t[0].properties.enum||t[0].properties.regulation)?7:t[0].properties?.format?.service?8:"number"===t[0].type?9:t[0].properties&&t[0].properties.multi?10:t[0].properties&&t[0].properties.view&&"lookup"!==t[0].properties.format?11:t[0].properties?.autocomplete?12:"lookup"===t[0].properties?.format?13:"boolean"===t[0].type?14:"date"===t[0].type?15:"dateRange"===t[0].type?16:"datetime"===t[0].type?17:"map"===t[0].properties?.format?18:"time"===t[0].properties?.format?19:"email"===t[0].type||"email"===t[0].properties?.format?20:"url"===t[0].properties?.format?21:"task"===t[0].properties?.format?22:"tel"===t[0].properties?.format?23:24}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_default_slot$3(t){let e,n;return e=new InputReference({props:{classId:t[9],eventId:t[10],disabled:!0,readonly:!0,id:t[39],item:t[0],value:t[28](),noList:!0,withRefValue:!0,refValue:t[27]}}),e.$on("setRefDesc",t[48]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),1&n[0]&&(r.item=t[0]),268435456&n[0]&&(r.value=t[28]()),134217728&n[0]&&(r.refValue=t[27]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$4(t){let e,n,r,o;const i=[create_if_block$3,create_if_block_1$3,create_if_block_2$2,create_else_block$2],a=[];function s(t,e){return t[5]||"reference"!==t[0].saveAs||"object"!==t[0].type?"html"===t[0].properties?.format?1:"divider"===t[0].type?2:3:0}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function instance$4(t,e,n){let r,o,i,a;const s=createEventDispatcher(),{FormField:c,TextField:l,DatePicker:d,TimePicker:u,Checkbox:h,Divider:m}=getAttractions,{environment:f}=user;component_subscribe(t,f,t=>n(51,a=t));let{praefix:p=""}=e,{item:_}=e,{listName:g=""}=e,{fullRecord:w}=e,{record:$}=e,{recordId:y}=e,{noForm:b=!1}=e,{classId:v}=e,{eventId:I}=e,{disabled:C}=e,{selectionFields:E}=e,{formnovalidate:A}=e,{selection:S=!1}=e,{notifyList:k}=e,{numberInput:T}=e,{deList:R}=e,{required:N}=e,{isTemplate:D}=e,{toDelete:x}=e,{reqQuantity:O}=e,{currency:M}=e,{changeValue:P}=e,{propSelection:B}=e,{multiValues:F}=e,{shortEdit:L}=e,{initFinished:q}=e,{dateInput:V}=e;y||=$._id;let{required:H,readonly:U,hidden:z,pattern:W,multiple:j,placeholder:G}=_.properties||{};if(z=!0===z,void 0!==U&&(U=!0===U),U||=y&&_.asInput,void 0===N&&(N=H),C=C||!!U,"string"==typeof _.name){const[t,e]=_.name.split("_");e&&(_.name=e)}const X=(g?g+".":"")+_.name,Q=X+(""!==p?"-"+p:""),Y=(t,e=X)=>{try{return e.split(".").reduce((t,e)=>t[e],t)}catch(t){return""}},Z=async t=>{const{list:e,values:n}=_.process;if(!t)return void s("save",{itemName:e,value:[],addToRecord:!0});const r={},o=await Request.getSchema(I);for(const t in n){const i=n[t];if(t.includes(".")){const[n,a]=t.split("."),s={[a]:i};let c=await Request.getSectionView(n,s);if(!c?.length)continue;c=c[0],r[n]=c._id;const l=o.list.find(t=>t.name===e);for(const t of l.item){const{name:e}=t;r[e]||(r[e]=c[e])}}else r[t]=i}s("save",{itemName:e,value:[r],addToRecord:!0})};let K=Y($);return t.$$set=t=>{"praefix"in t&&n(5,p=t.praefix),"item"in t&&n(0,_=t.item),"listName"in t&&n(6,g=t.listName),"fullRecord"in t&&n(7,w=t.fullRecord),"record"in t&&n(1,$=t.record),"recordId"in t&&n(2,y=t.recordId),"noForm"in t&&n(8,b=t.noForm),"classId"in t&&n(9,v=t.classId),"eventId"in t&&n(10,I=t.eventId),"disabled"in t&&n(3,C=t.disabled),"selectionFields"in t&&n(11,E=t.selectionFields),"formnovalidate"in t&&n(12,A=t.formnovalidate),"selection"in t&&n(13,S=t.selection),"notifyList"in t&&n(24,k=t.notifyList),"numberInput"in t&&n(14,T=t.numberInput),"deList"in t&&n(15,R=t.deList),"required"in t&&n(4,N=t.required),"isTemplate"in t&&n(16,D=t.isTemplate),"toDelete"in t&&n(17,x=t.toDelete),"reqQuantity"in t&&n(18,O=t.reqQuantity),"currency"in t&&n(19,M=t.currency),"changeValue"in t&&n(49,P=t.changeValue),"propSelection"in t&&n(50,B=t.propSelection),"multiValues"in t&&n(20,F=t.multiValues),"shortEdit"in t&&n(21,L=t.shortEdit),"initFinished"in t&&n(22,q=t.initFinished),"dateInput"in t&&n(23,V=t.dateInput)},t.$$.update=()=>{if(1&t.$$.dirty[0]|524288&t.$$.dirty[1]&&B&&_.properties?.selection){const{refClass:t,refItem:e,target:n}=_.properties.selection,r=B.record[t];s("propSelection",{itemName:_.name,itemType:_.type,prop:e,target:n,source:t,sourceId:r})}if(262144&t.$$.dirty[1])for(const t in P)t===X&&n(1,$[X]=P[t],$);7&t.$$.dirty[0]|1048576&t.$$.dirty[1]&&n(28,r=(t=!1)=>{let e;return y||"number"!==_.type&&"string"!==_.type||!_.refItemAlt?.startsWith||!_.refItemAlt.startsWith("owner.")||+Y($)?y||"number"!==_.type&&"string"!==_.type||!_.refItem?.startsWith||!_.refItem.startsWith("owner.")?(e=Y($),!e&&_.properties?.useId&&(e=$._id),t&&(e=!!e),void 0===e?"":e):(e=Y(a,_.refItem),void 0===e?"":e):(e=Y(a,_.refItemAlt),void 0===e?"":e)}),2&t.$$.dirty[0]&&(i=Y($))},n(29,o=((t=X)=>{let e=$["_"+t];return e=checkDate(e),void 0===e?"":e})()),[_,$,y,C,N,p,g,w,b,v,I,E,A,S,T,R,D,x,O,M,F,L,q,V,k,U,z,K,r,o,c,l,h,m,f,W,j,G,X,Q,(t=X)=>{let e=Y($);return e?new Date(e):""===p?(()=>{const t=new Date;return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()-1,23))})():void 0},(t=X)=>{const e=Y($,t+"_from"),n=Y($,t+"_to");return{from:void 0===e?e:new Date(e),to:void 0===n?n:new Date(n)}},t=>({detail:e})=>{let{value:r,checked:o,range:a}=e;void 0!==o&&(r=o);const c=X+(a||"");n(1,$[c]=t?formatDateTime(r,"%d.%m.%Y"):r,$);const l=Object.values($).every(t=>!t)&&r;s("notify",{oldValue:i,value:r,add:l,itemName:c,desc:e.description}),"boolean"===_.type&&_.process&&Z(o)},({detail:t})=>{s("record",t)},({detail:t})=>{s("multi",t)},()=>n(26,z=!0),()=>"object"===_.type?"comment_"+Q:Q,({detail:t})=>{n(27,K=t)},({detail:t})=>{const{designation:e}=_;n(29,o=e+": "+(t||"(Neu)"))},P,B,a,function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)}]}class InputFormField extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-rxh0vh-style")||add_css$3(),init(this,t,instance$4,create_fragment$4,safe_not_equal,{praefix:5,item:0,listName:6,fullRecord:7,record:1,recordId:2,noForm:8,classId:9,eventId:10,disabled:3,selectionFields:11,formnovalidate:12,selection:13,notifyList:24,numberInput:14,deList:15,required:4,isTemplate:16,toDelete:17,reqQuantity:18,currency:19,changeValue:49,propSelection:50,multiValues:20,shortEdit:21,initFinished:22,dateInput:23},[-1,-1,-1])}}var Html5QrcodeSupportedFormats;!function(t){t[t.QR_CODE=0]="QR_CODE",t[t.AZTEC=1]="AZTEC",t[t.CODABAR=2]="CODABAR",t[t.CODE_39=3]="CODE_39",t[t.CODE_93=4]="CODE_93",t[t.CODE_128=5]="CODE_128",t[t.DATA_MATRIX=6]="DATA_MATRIX",t[t.MAXICODE=7]="MAXICODE",t[t.ITF=8]="ITF",t[t.EAN_13=9]="EAN_13",t[t.EAN_8=10]="EAN_8",t[t.PDF_417=11]="PDF_417",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Html5QrcodeSupportedFormats||(Html5QrcodeSupportedFormats={}));var html5QrcodeSupportedFormatsTextMap=new Map([[Html5QrcodeSupportedFormats.QR_CODE,"QR_CODE"],[Html5QrcodeSupportedFormats.AZTEC,"AZTEC"],[Html5QrcodeSupportedFormats.CODABAR,"CODABAR"],[Html5QrcodeSupportedFormats.CODE_39,"CODE_39"],[Html5QrcodeSupportedFormats.CODE_93,"CODE_93"],[Html5QrcodeSupportedFormats.CODE_128,"CODE_128"],[Html5QrcodeSupportedFormats.DATA_MATRIX,"DATA_MATRIX"],[Html5QrcodeSupportedFormats.MAXICODE,"MAXICODE"],[Html5QrcodeSupportedFormats.ITF,"ITF"],[Html5QrcodeSupportedFormats.EAN_13,"EAN_13"],[Html5QrcodeSupportedFormats.EAN_8,"EAN_8"],[Html5QrcodeSupportedFormats.PDF_417,"PDF_417"],[Html5QrcodeSupportedFormats.RSS_14,"RSS_14"],[Html5QrcodeSupportedFormats.RSS_EXPANDED,"RSS_EXPANDED"],[Html5QrcodeSupportedFormats.UPC_A,"UPC_A"],[Html5QrcodeSupportedFormats.UPC_E,"UPC_E"],[Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),DecodedTextType,Html5QrcodeScanType;function isValidHtml5QrcodeSupportedFormats(t){return Object.values(Html5QrcodeSupportedFormats).includes(t)}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.URL=1]="URL"}(DecodedTextType||(DecodedTextType={})),function(t){t[t.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",t[t.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"}(Html5QrcodeScanType||(Html5QrcodeScanType={}));var Html5QrcodeConstants=function(){function t(){}return t.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",t.SCAN_DEFAULT_FPS=2,t.DEFAULT_DISABLE_FLIP=!1,t.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,t.DEFAULT_SUPPORTED_SCAN_TYPE=[Html5QrcodeScanType.SCAN_TYPE_CAMERA,Html5QrcodeScanType.SCAN_TYPE_FILE],t}(),QrcodeResultFormat=function(){function t(t,e){this.format=t,this.formatName=e}return t.prototype.toString=function(){return this.formatName},t.create=function(e){if(!html5QrcodeSupportedFormatsTextMap.has(e))throw"".concat(e," not in html5QrcodeSupportedFormatsTextMap");return new t(e,html5QrcodeSupportedFormatsTextMap.get(e))},t}(),Html5QrcodeResultFactory=function(){function t(){}return t.createFromText=function(t){return{decodedText:t,result:{text:t}}},t.createFromQrcodeResult=function(t){return{decodedText:t.text,result:t}},t}(),Html5QrcodeErrorTypes;!function(t){t[t.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",t[t.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",t[t.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"}(Html5QrcodeErrorTypes||(Html5QrcodeErrorTypes={}));var Html5QrcodeErrorFactory=function(){function t(){}return t.createFrom=function(t){return{errorMessage:t,type:Html5QrcodeErrorTypes.UNKWOWN_ERROR}},t}(),BaseLoggger=function(){function t(t){this.verbose=t}return t.prototype.log=function(t){this.verbose&&console.log(t)},t.prototype.warn=function(t){this.verbose&&console.warn(t)},t.prototype.logError=function(t,e){(this.verbose||!0===e)&&console.error(t)},t.prototype.logErrors=function(t){if(0===t.length)throw"Logger#logError called without arguments";this.verbose&&console.error(t)},t}();function isNullOrUndefined(t){return null==t}var Html5QrcodeStrings=function(){function t(){}return t.codeParseError=function(t){return"QR code parse error, error = ".concat(t)},t.errorGettingUserMedia=function(t){return"Error getting userMedia, error = ".concat(t)},t.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},t.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},t.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},t.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},t.scannerPaused=function(){return"Scanner paused"},t}(),VideoConstraintsUtil=function(){function t(){}return t.isMediaStreamConstraintsValid=function(t,e){if("object"!=typeof t){var n=typeof t;return e.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(n,"."),!0),!1}for(var r=new Set(["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"]),o=0,i=Object.keys(t);o<i.length;o++){var a=i[o];if(r.has(a))return e.logError("".concat(a," is not supported videoConstaints."),!0),!1}return!0},t}(),zxingJs_umd=createCommonjsModule(function(t,e){!function(t){function e(t){return null==t}var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function r(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function o(t,e){var n=Object.setPrototypeOf;n?n(t,e):t.__proto__=e}function i(t,e){void 0===e&&(e=t.constructor);var n=Error.captureStackTrace;n&&n(t,e)}var a,s=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.defineProperty(r,"name",{value:n.name,enumerable:!1}),o(r,n.prototype),i(r),r}return r(e,t),e}(Error);class c extends s{constructor(t=void 0){super(t),this.message=t}getKind(){return this.constructor.kind}}c.kind="Exception";class l extends c{}l.kind="ArgumentException";class d extends c{}d.kind="IllegalArgumentException";class u{constructor(t){if(this.binarizer=t,null===t)throw new d("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(t,e){return this.binarizer.getBlackRow(t,e)}getBlackMatrix(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(t,e,n,r){const o=this.binarizer.getLuminanceSource().crop(t,e,n,r);return new u(this.binarizer.createBinarizer(o))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new u(this.binarizer.createBinarizer(t))}rotateCounterClockwise45(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new u(this.binarizer.createBinarizer(t))}toString(){try{return this.getBlackMatrix().toString()}catch(t){return""}}}class h extends c{static getChecksumInstance(){return new h}}h.kind="ChecksumException";class m{constructor(t){this.source=t}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class f{static arraycopy(t,e,n,r,o){for(;o--;)n[r++]=t[e++]}static currentTimeMillis(){return Date.now()}}class p extends c{}p.kind="IndexOutOfBoundsException";class _ extends p{constructor(t=void 0,e=void 0){super(e),this.index=t,this.message=e}}_.kind="ArrayIndexOutOfBoundsException";class g{static fill(t,e){for(let n=0,r=t.length;n<r;n++)t[n]=e}static fillWithin(t,e,n,r){g.rangeCheck(t.length,e,n);for(let o=e;o<n;o++)t[o]=r}static rangeCheck(t,e,n){if(e>n)throw new d("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new _(e);if(n>t)throw new _(n)}static asList(...t){return t}static create(t,e,n){return Array.from({length:t}).map(t=>Array.from({length:e}).fill(n))}static createInt32Array(t,e,n){return Array.from({length:t}).map(t=>Int32Array.from({length:e}).fill(n))}static equals(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}static hashCode(t){if(null===t)return 0;let e=1;for(const n of t)e=31*e+n;return e}static fillUint8Array(t,e){for(let n=0;n!==t.length;n++)t[n]=e}static copyOf(t,e){return t.slice(0,e)}static copyOfUint8Array(t,e){if(t.length<=e){const n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)}static copyOfRange(t,e,n){const r=n-e,o=new Int32Array(r);return f.arraycopy(t,e,o,0,r),o}static binarySearch(t,e,n){void 0===n&&(n=g.numberComparator);let r=0,o=t.length-1;for(;r<=o;){const i=o+r>>1,a=n(e,t[i]);if(a>0)r=i+1;else{if(!(a<0))return i;o=i-1}}return-r-1}static numberComparator(t,e){return t-e}}class w{static numberOfTrailingZeros(t){let e;if(0===t)return 32;let n=31;return e=t<<16,0!==e&&(n-=16,t=e),e=t<<8,0!==e&&(n-=8,t=e),e=t<<4,0!==e&&(n-=4,t=e),e=t<<2,0!==e&&(n-=2,t=e),n-(t<<1>>>31)}static numberOfLeadingZeros(t){if(0===t)return 32;let e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-=t>>>31,e}static toHexString(t){return t.toString(16)}static toBinaryString(t){return String(parseInt(String(t),2))}static bitCount(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)}static truncDivision(t,e){return Math.trunc(t/e)}static parseInt(t,e=void 0){return parseInt(t,e)}}w.MIN_VALUE_32_BITS=-2147483648,w.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ${constructor(t,e){void 0===t?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=null==e?$.makeArray(t):e)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(t){if(t>32*this.bits.length){const e=$.makeArray(t);f.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}}get(t){return!!(this.bits[Math.floor(t/32)]&1<<(31&t))}set(t){this.bits[Math.floor(t/32)]|=1<<(31&t)}flip(t){this.bits[Math.floor(t/32)]^=1<<(31&t)}getNextSet(t){const e=this.size;if(t>=e)return e;const n=this.bits;let r=Math.floor(t/32),o=n[r];o&=~((1<<(31&t))-1);const i=n.length;for(;0===o;){if(++r===i)return e;o=n[r]}const a=32*r+w.numberOfTrailingZeros(o);return a>e?e:a}getNextUnset(t){const e=this.size;if(t>=e)return e;const n=this.bits;let r=Math.floor(t/32),o=~n[r];o&=~((1<<(31&t))-1);const i=n.length;for(;0===o;){if(++r===i)return e;o=~n[r]}const a=32*r+w.numberOfTrailingZeros(o);return a>e?e:a}setBulk(t,e){this.bits[Math.floor(t/32)]=e}setRange(t,e){if(e<t||t<0||e>this.size)throw new d;if(e===t)return;e--;const n=Math.floor(t/32),r=Math.floor(e/32),o=this.bits;for(let i=n;i<=r;i++){const a=(2<<(i<r?31:31&e))-(1<<(i>n?0:31&t));o[i]|=a}}clear(){const t=this.bits.length,e=this.bits;for(let n=0;n<t;n++)e[n]=0}isRange(t,e,n){if(e<t||t<0||e>this.size)throw new d;if(e===t)return!0;e--;const r=Math.floor(t/32),o=Math.floor(e/32),i=this.bits;for(let a=r;a<=o;a++){const s=(2<<(a<o?31:31&e))-(1<<(a>r?0:31&t))&4294967295;if((i[a]&s)!==(n?s:0))return!1}return!0}appendBit(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++}appendBits(t,e){if(e<0||e>32)throw new d("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(let n=e;n>0;n--)this.appendBit(1==(t>>n-1&1))}appendBitArray(t){const e=t.size;this.ensureCapacity(this.size+e);for(let n=0;n<e;n++)this.appendBit(t.get(n))}xor(t){if(this.size!==t.size)throw new d("Sizes don't match");const e=this.bits;for(let n=0,r=e.length;n<r;n++)e[n]^=t.bits[n]}toBytes(t,e,n,r){for(let o=0;o<r;o++){let r=0;for(let e=0;e<8;e++)this.get(t)&&(r|=1<<7-e),t++;e[n+o]=r}}getBitArray(){return this.bits}reverse(){const t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+1,r=this.bits;for(let o=0;o<n;o++){let n=r[o];n=n>>1&1431655765|(1431655765&n)<<1,n=n>>2&858993459|(858993459&n)<<2,n=n>>4&252645135|(252645135&n)<<4,n=n>>8&16711935|(16711935&n)<<8,n=n>>16&65535|(65535&n)<<16,t[e-o]=n}if(this.size!==32*n){const e=32*n-this.size;let r=t[0]>>>e;for(let o=1;o<n;o++){const n=t[o];r|=n<<32-e,t[o-1]=r,r=n>>>e}t[n-1]=r}this.bits=t}static makeArray(t){return new Int32Array(Math.floor((t+31)/32))}equals(t){if(!(t instanceof $))return!1;const e=t;return this.size===e.size&&g.equals(this.bits,e.bits)}hashCode(){return 31*this.size+g.hashCode(this.bits)}toString(){let t="";for(let e=0,n=this.size;e<n;e++)7&e||(t+=" "),t+=this.get(e)?"X":".";return t}clone(){return new $(this.size,this.bits.slice())}}!function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ASSUME_GS1=7]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"}(a||(a={}));var y,b=a;class v extends c{static getFormatInstance(){return new v}}v.kind="FormatException",function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"}(y||(y={}));class I{constructor(t,e,n,...r){this.valueIdentifier=t,this.name=n,this.values="number"==typeof e?Int32Array.from([e]):e,this.otherEncodingNames=r,I.VALUE_IDENTIFIER_TO_ECI.set(t,this),I.NAME_TO_ECI.set(n,this);const o=this.values;for(let t=0,e=o.length;t!==e;t++){const e=o[t];I.VALUES_TO_ECI.set(e,this)}for(const t of r)I.NAME_TO_ECI.set(t,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(t){if(t<0||t>=900)throw new v("incorect value");const e=I.VALUES_TO_ECI.get(t);if(void 0===e)throw new v("incorect value");return e}static getCharacterSetECIByName(t){const e=I.NAME_TO_ECI.get(t);if(void 0===e)throw new v("incorect value");return e}equals(t){if(!(t instanceof I))return!1;const e=t;return this.getName()===e.getName()}}I.VALUE_IDENTIFIER_TO_ECI=new Map,I.VALUES_TO_ECI=new Map,I.NAME_TO_ECI=new Map,I.Cp437=new I(y.Cp437,Int32Array.from([0,2]),"Cp437"),I.ISO8859_1=new I(y.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),I.ISO8859_2=new I(y.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),I.ISO8859_3=new I(y.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),I.ISO8859_4=new I(y.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),I.ISO8859_5=new I(y.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),I.ISO8859_6=new I(y.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),I.ISO8859_7=new I(y.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),I.ISO8859_8=new I(y.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),I.ISO8859_9=new I(y.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),I.ISO8859_10=new I(y.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),I.ISO8859_11=new I(y.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),I.ISO8859_13=new I(y.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),I.ISO8859_14=new I(y.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),I.ISO8859_15=new I(y.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),I.ISO8859_16=new I(y.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),I.SJIS=new I(y.SJIS,20,"SJIS","Shift_JIS"),I.Cp1250=new I(y.Cp1250,21,"Cp1250","windows-1250"),I.Cp1251=new I(y.Cp1251,22,"Cp1251","windows-1251"),I.Cp1252=new I(y.Cp1252,23,"Cp1252","windows-1252"),I.Cp1256=new I(y.Cp1256,24,"Cp1256","windows-1256"),I.UnicodeBigUnmarked=new I(y.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),I.UTF8=new I(y.UTF8,26,"UTF8","UTF-8"),I.ASCII=new I(y.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),I.Big5=new I(y.Big5,28,"Big5"),I.GB18030=new I(y.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),I.EUC_KR=new I(y.EUC_KR,30,"EUC_KR","EUC-KR");class C extends c{}C.kind="UnsupportedOperationException";class E{static decode(t,e){const n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)}static shouldDecodeOnFallback(t){return!E.isBrowser()&&"ISO-8859-1"===t}static encode(t,e){const n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)}static isBrowser(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)}static encodingName(t){return"string"==typeof t?t:t.getName()}static encodingCharacterSet(t){return t instanceof I?t:I.getCharacterSetECIByName(t)}static decodeFallback(t,e){const n=this.encodingCharacterSet(e);if(E.isDecodeFallbackSupported(n)){let e="";for(let n=0,r=t.length;n<r;n++){let r=t[n].toString(16);r.length<2&&(r="0"+r),e+="%"+r}return decodeURIComponent(e)}if(n.equals(I.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new C(`Encoding ${this.encodingName(e)} not supported by fallback.`)}static isDecodeFallbackSupported(t){return t.equals(I.UTF8)||t.equals(I.ISO8859_1)||t.equals(I.ASCII)}static encodeFallback(t){const e=btoa(unescape(encodeURIComponent(t))).split(""),n=[];for(let t=0;t<e.length;t++)n.push(e[t].charCodeAt(0));return new Uint8Array(n)}}class A{static castAsNonUtf8Char(t,e=null){const n=e?e.getName():this.ISO88591;return E.decode(new Uint8Array([t]),n)}static guessEncoding(t,e){if(null!=e&&void 0!==e.get(b.CHARACTER_SET))return e.get(b.CHARACTER_SET).toString();const n=t.length;let r=!0,o=!0,i=!0,a=0,s=0,c=0,l=0,d=0,u=0,h=0,m=0,f=0,p=0,_=0;const g=t.length>3&&239===t[0]&&187===t[1]&&191===t[2];for(let e=0;e<n&&(r||o||i);e++){const n=255&t[e];i&&(a>0?128&n?a--:i=!1:128&n&&(64&n?(a++,32&n?(a++,16&n?(a++,8&n?i=!1:l++):c++):s++):i=!1)),r&&(n>127&&n<160?r=!1:n>159&&(n<192||215===n||247===n)&&_++),o&&(d>0?n<64||127===n||n>252?o=!1:d--:128===n||160===n||n>239?o=!1:n>160&&n<224?(u++,m=0,h++,h>f&&(f=h)):n>127?(d++,h=0,m++,m>p&&(p=m)):(h=0,m=0))}return i&&a>0&&(i=!1),o&&d>0&&(o=!1),i&&(g||s+c+l>0)?A.UTF8:o&&(A.ASSUME_SHIFT_JIS||f>=3||p>=3)?A.SHIFT_JIS:r&&o?2===f&&2===u||10*_>=n?A.SHIFT_JIS:A.ISO88591:r?A.ISO88591:o?A.SHIFT_JIS:i?A.UTF8:A.PLATFORM_DEFAULT_ENCODING}static format(t,...e){let n=-1;function r(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0===e[++n])return;t=i?parseInt(i.substr(1)):void 0;let c,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":c=e[n];break;case"c":c=e[n][0];break;case"f":c=parseFloat(e[n]).toFixed(t);break;case"p":c=parseFloat(e[n]).toPrecision(t);break;case"e":c=parseFloat(e[n]).toExponential(t);break;case"x":c=parseInt(e[n]).toString(l||16);break;case"d":c=parseFloat(parseInt(e[n],l||10).toPrecision(t)).toFixed(0)}c="object"==typeof c?JSON.stringify(c):(+c).toString(l);let d=parseInt(o),u=o&&o[0]+""=="0"?"0":" ";for(;c.length<d;)c=void 0!==r?c+u:u+c;return c}let o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,r)}static getBytes(t,e){return E.encode(t,e)}static getCharCode(t,e=0){return t.charCodeAt(e)}static getCharAt(t){return String.fromCharCode(t)}}A.SHIFT_JIS=I.SJIS.getName(),A.GB2312="GB2312",A.ISO88591=I.ISO8859_1.getName(),A.EUC_JP="EUC_JP",A.UTF8=I.UTF8.getName(),A.PLATFORM_DEFAULT_ENCODING=A.UTF8,A.ASSUME_SHIFT_JIS=!1;class S{constructor(t=""){this.value=t}enableDecoding(t){return this.encoding=t,this}append(t){return"string"==typeof t?this.value+=t.toString():this.encoding?this.value+=A.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this}appendChars(t,e,n){for(let r=e;e<e+n;r++)this.append(t[r]);return this}length(){return this.value.length}charAt(t){return this.value.charAt(t)}deleteCharAt(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)}setCharAt(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)}substring(t,e){return this.value.substring(t,e)}setLengthToZero(){this.value=""}toString(){return this.value}insert(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)}}class k{constructor(t,e,n,r){if(this.width=t,this.height=e,this.rowSize=n,this.bits=r,null==e&&(e=t),this.height=e,t<1||e<1)throw new d("Both dimensions must be greater than 0");null==n&&(n=Math.floor((t+31)/32)),this.rowSize=n,null==r&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(t){const e=t.length,n=t[0].length,r=new k(n,e);for(let o=0;o<e;o++){const e=t[o];for(let t=0;t<n;t++)e[t]&&r.set(t,o)}return r}static parseFromString(t,e,n){if(null===t)throw new d("stringRepresentation cannot be null");const r=new Array(t.length);let o=0,i=0,a=-1,s=0,c=0;for(;c<t.length;)if("\n"===t.charAt(c)||"\r"===t.charAt(c)){if(o>i){if(-1===a)a=o-i;else if(o-i!==a)throw new d("row lengths do not match");i=o,s++}c++}else if(t.substring(c,c+e.length)===e)c+=e.length,r[o]=!0,o++;else{if(t.substring(c,c+n.length)!==n)throw new d("illegal character encountered: "+t.substring(c));c+=n.length,r[o]=!1,o++}if(o>i){if(-1===a)a=o-i;else if(o-i!==a)throw new d("row lengths do not match");s++}const l=new k(a,s);for(let t=0;t<o;t++)r[t]&&l.set(Math.floor(t%a),Math.floor(t/a));return l}get(t,e){const n=e*this.rowSize+Math.floor(t/32);return!!(this.bits[n]>>>(31&t)&1)}set(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(31&t)&4294967295}unset(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(31&t)&4294967295)}flip(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(31&t)&4294967295}xor(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new d("input matrix dimensions do not match");const e=new $(Math.floor(this.width/32)+1),n=this.rowSize,r=this.bits;for(let o=0,i=this.height;o<i;o++){const i=o*n,a=t.getRow(o,e).getBitArray();for(let t=0;t<n;t++)r[i+t]^=a[t]}}clear(){const t=this.bits,e=t.length;for(let n=0;n<e;n++)t[n]=0}setRegion(t,e,n,r){if(e<0||t<0)throw new d("Left and top must be nonnegative");if(r<1||n<1)throw new d("Height and width must be at least 1");const o=t+n,i=e+r;if(i>this.height||o>this.width)throw new d("The region must fit inside the matrix");const a=this.rowSize,s=this.bits;for(let n=e;n<i;n++){const e=n*a;for(let n=t;n<o;n++)s[e+Math.floor(n/32)]|=1<<(31&n)&4294967295}}getRow(t,e){null==e||e.getSize()<this.width?e=new $(this.width):e.clear();const n=this.rowSize,r=this.bits,o=t*n;for(let t=0;t<n;t++)e.setBulk(32*t,r[o+t]);return e}setRow(t,e){f.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)}rotate180(){const t=this.getWidth(),e=this.getHeight();let n=new $(t),r=new $(t);for(let t=0,o=Math.floor((e+1)/2);t<o;t++)n=this.getRow(t,n),r=this.getRow(e-1-t,r),n.reverse(),r.reverse(),this.setRow(t,r),this.setRow(e-1-t,n)}getEnclosingRectangle(){const t=this.width,e=this.height,n=this.rowSize,r=this.bits;let o=t,i=e,a=-1,s=-1;for(let t=0;t<e;t++)for(let e=0;e<n;e++){const c=r[t*n+e];if(0!==c){if(t<i&&(i=t),t>s&&(s=t),32*e<o){let t=0;for(;!(c<<31-t&4294967295);)t++;32*e+t<o&&(o=32*e+t)}if(32*e+31>a){let t=31;for(;c>>>t===0;)t--;32*e+t>a&&(a=32*e+t)}}}return a<o||s<i?null:Int32Array.from([o,i,a-o+1,s-i+1])}getTopLeftOnBit(){const t=this.rowSize,e=this.bits;let n=0;for(;n<e.length&&0===e[n];)n++;if(n===e.length)return null;const r=n/t;let o=n%t*32;const i=e[n];let a=0;for(;!(i<<31-a&4294967295);)a++;return o+=a,Int32Array.from([o,r])}getBottomRightOnBit(){const t=this.rowSize,e=this.bits;let n=e.length-1;for(;n>=0&&0===e[n];)n--;if(n<0)return null;const r=Math.floor(n/t);let o=32*Math.floor(n%t);const i=e[n];let a=31;for(;i>>>a===0;)a--;return o+=a,Int32Array.from([o,r])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(t){if(!(t instanceof k))return!1;const e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&g.equals(this.bits,e.bits)}hashCode(){let t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+g.hashCode(this.bits),t}toString(t="X ",e=" ",n="\n"){return this.buildToString(t,e,n)}buildToString(t,e,n){let r=new S;for(let o=0,i=this.height;o<i;o++){for(let n=0,i=this.width;n<i;n++)r.append(this.get(n,o)?t:e);r.append(n)}return r.toString()}clone(){return new k(this.width,this.height,this.rowSize,this.bits.slice())}}class T extends c{static getNotFoundInstance(){return new T}}T.kind="NotFoundException";class R extends m{constructor(t){super(t),this.luminances=R.EMPTY,this.buckets=new Int32Array(R.LUMINANCE_BUCKETS)}getBlackRow(t,e){const n=this.getLuminanceSource(),r=n.getWidth();null==e||e.getSize()<r?e=new $(r):e.clear(),this.initArrays(r);const o=n.getRow(t,this.luminances),i=this.buckets;for(let t=0;t<r;t++)i[(255&o[t])>>R.LUMINANCE_SHIFT]++;const a=R.estimateBlackPoint(i);if(r<3)for(let t=0;t<r;t++)(255&o[t])<a&&e.set(t);else{let t=255&o[0],n=255&o[1];for(let i=1;i<r-1;i++){const r=255&o[i+1];(4*n-t-r)/2<a&&e.set(i),t=n,n=r}}return e}getBlackMatrix(){const t=this.getLuminanceSource(),e=t.getWidth(),n=t.getHeight(),r=new k(e,n);this.initArrays(e);const o=this.buckets;for(let r=1;r<5;r++){const i=Math.floor(n*r/5),a=t.getRow(i,this.luminances),s=Math.floor(4*e/5);for(let t=Math.floor(e/5);t<s;t++)o[(255&a[t])>>R.LUMINANCE_SHIFT]++}const i=R.estimateBlackPoint(o),a=t.getMatrix();for(let t=0;t<n;t++){const n=t*e;for(let o=0;o<e;o++)(255&a[n+o])<i&&r.set(o,t)}return r}createBinarizer(t){return new R(t)}initArrays(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));const e=this.buckets;for(let t=0;t<R.LUMINANCE_BUCKETS;t++)e[t]=0}static estimateBlackPoint(t){const e=t.length;let n=0,r=0,o=0;for(let i=0;i<e;i++)t[i]>o&&(r=i,o=t[i]),t[i]>n&&(n=t[i]);let i=0,a=0;for(let n=0;n<e;n++){const e=n-r,o=t[n]*e*e;o>a&&(i=n,a=o)}if(r>i){const t=r;r=i,i=t}if(i-r<=e/16)throw new T;let s=i-1,c=-1;for(let e=i-1;e>r;e--){const o=e-r,a=o*o*(i-e)*(n-t[e]);a>c&&(s=e,c=a)}return s<<R.LUMINANCE_SHIFT}}R.LUMINANCE_BITS=5,R.LUMINANCE_SHIFT=8-R.LUMINANCE_BITS,R.LUMINANCE_BUCKETS=1<<R.LUMINANCE_BITS,R.EMPTY=Uint8ClampedArray.from([0]);class N extends R{constructor(t){super(t),this.matrix=null}getBlackMatrix(){if(null!==this.matrix)return this.matrix;const t=this.getLuminanceSource(),e=t.getWidth(),n=t.getHeight();if(e>=N.MINIMUM_DIMENSION&&n>=N.MINIMUM_DIMENSION){const r=t.getMatrix();let o=e>>N.BLOCK_SIZE_POWER;0!==(e&N.BLOCK_SIZE_MASK)&&o++;let i=n>>N.BLOCK_SIZE_POWER;0!==(n&N.BLOCK_SIZE_MASK)&&i++;const a=N.calculateBlackPoints(r,o,i,e,n),s=new k(e,n);N.calculateThresholdForBlock(r,o,i,e,n,a,s),this.matrix=s}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(t){return new N(t)}static calculateThresholdForBlock(t,e,n,r,o,i,a){const s=o-N.BLOCK_SIZE,c=r-N.BLOCK_SIZE;for(let o=0;o<n;o++){let l=o<<N.BLOCK_SIZE_POWER;l>s&&(l=s);const d=N.cap(o,2,n-3);for(let n=0;n<e;n++){let o=n<<N.BLOCK_SIZE_POWER;o>c&&(o=c);const s=N.cap(n,2,e-3);let u=0;for(let t=-2;t<=2;t++){const e=i[d+t];u+=e[s-2]+e[s-1]+e[s]+e[s+1]+e[s+2]}const h=u/25;N.thresholdBlock(t,o,l,h,r,a)}}}static cap(t,e,n){return t<e?e:t>n?n:t}static thresholdBlock(t,e,n,r,o,i){for(let a=0,s=n*o+e;a<N.BLOCK_SIZE;a++,s+=o)for(let o=0;o<N.BLOCK_SIZE;o++)(255&t[s+o])<=r&&i.set(e+o,n+a)}static calculateBlackPoints(t,e,n,r,o){const i=o-N.BLOCK_SIZE,a=r-N.BLOCK_SIZE,s=new Array(n);for(let o=0;o<n;o++){s[o]=new Int32Array(e);let n=o<<N.BLOCK_SIZE_POWER;n>i&&(n=i);for(let i=0;i<e;i++){let e=i<<N.BLOCK_SIZE_POWER;e>a&&(e=a);let c=0,l=255,d=0;for(let o=0,i=n*r+e;o<N.BLOCK_SIZE;o++,i+=r){for(let e=0;e<N.BLOCK_SIZE;e++){const n=255&t[i+e];c+=n,n<l&&(l=n),n>d&&(d=n)}if(d-l>N.MIN_DYNAMIC_RANGE)for(o++,i+=r;o<N.BLOCK_SIZE;o++,i+=r)for(let e=0;e<N.BLOCK_SIZE;e++)c+=255&t[i+e]}let u=c>>2*N.BLOCK_SIZE_POWER;if(d-l<=N.MIN_DYNAMIC_RANGE&&(u=l/2,o>0&&i>0)){const t=(s[o-1][i]+2*s[o][i-1]+s[o-1][i-1])/4;l<t&&(u=t)}s[o][i]=u}}return s}}N.BLOCK_SIZE_POWER=3,N.BLOCK_SIZE=1<<N.BLOCK_SIZE_POWER,N.BLOCK_SIZE_MASK=N.BLOCK_SIZE-1,N.MINIMUM_DIMENSION=5*N.BLOCK_SIZE,N.MIN_DYNAMIC_RANGE=24;class D{constructor(t,e){this.width=t,this.height=e}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(t,e,n,r){throw new C("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new C("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new C("This luminance source does not support rotation by 45 degrees.")}toString(){const t=new Uint8ClampedArray(this.width);let e=new S;for(let n=0;n<this.height;n++){const r=this.getRow(n,t);for(let t=0;t<this.width;t++){const n=255&r[t];let o;o=n<64?"#":n<128?"+":n<192?".":" ",e.append(o)}e.append("\n")}return e.toString()}}class x extends D{constructor(t){super(t.getWidth(),t.getHeight()),this.delegate=t}getRow(t,e){const n=this.delegate.getRow(t,e),r=this.getWidth();for(let t=0;t<r;t++)n[t]=255-(255&n[t]);return n}getMatrix(){const t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(e);for(let r=0;r<e;r++)n[r]=255-(255&t[r]);return n}isCropSupported(){return this.delegate.isCropSupported()}crop(t,e,n,r){return new x(this.delegate.crop(t,e,n,r))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new x(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new x(this.delegate.rotateCounterClockwise45())}}class O extends D{constructor(t){super(t.width,t.height),this.canvas=t,this.tempCanvasElement=null,this.buffer=O.makeBufferFromCanvasImageData(t)}static makeBufferFromCanvasImageData(t){const e=t.getContext("2d").getImageData(0,0,t.width,t.height);return O.toGrayscaleBuffer(e.data,t.width,t.height)}static toGrayscaleBuffer(t,e,n){const r=new Uint8ClampedArray(e*n);for(let e=0,n=0,o=t.length;e<o;e+=4,n++){let o;o=0===t[e+3]?255:306*t[e]+601*t[e+1]+117*t[e+2]+512>>10,r[n]=o}return r}getRow(t,e){if(t<0||t>=this.getHeight())throw new d("Requested row is outside the image: "+t);const n=this.getWidth(),r=t*n;return null===e?e=this.buffer.slice(r,r+n):(e.length<n&&(e=new Uint8ClampedArray(n)),e.set(this.buffer.slice(r,r+n))),e}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(t,e,n,r){return super.crop(t,e,n,r),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(null===this.tempCanvasElement){const t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement}rotate(t){const e=this.getTempCanvasElement(),n=e.getContext("2d"),r=t*O.DEGREE_TO_RADIANS,o=this.canvas.width,i=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(r))*o+Math.abs(Math.sin(r))*i),s=Math.ceil(Math.abs(Math.sin(r))*o+Math.abs(Math.cos(r))*i);return e.width=a,e.height=s,n.translate(a/2,s/2),n.rotate(r),n.drawImage(this.canvas,o/-2,i/-2),this.buffer=O.makeBufferFromCanvasImageData(e),this}invert(){return new x(this)}}O.DEGREE_TO_RADIANS=Math.PI/180;class M{constructor(t,e,n){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=n||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var P,B=(globalThis||commonjsGlobal||self||window?(globalThis||commonjsGlobal||self||window||void 0).__awaiter:void 0)||function(t,e,n,r){function o(t){return t instanceof n?t:new n(function(e){e(t)})}return new(n||(n=Promise))(function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())})};class F{constructor(t,e=500,n){this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return"undefined"!=typeof navigator}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(t){this._timeBetweenDecodingAttempts=t<0?0:t}set hints(t){this._hints=t||null}get hints(){return this._hints}listVideoInputDevices(){return B(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const t=yield navigator.mediaDevices.enumerateDevices(),e=[];for(const n of t){const t="video"===n.kind?"videoinput":n.kind;if("videoinput"!==t)continue;const r={deviceId:n.deviceId||n.id,label:n.label||`Video device ${e.length+1}`,kind:t,groupId:n.groupId};e.push(r)}return e})}getVideoInputDevices(){return B(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(t=>new M(t.deviceId,t.label))})}findDeviceById(t){return B(this,void 0,void 0,function*(){const e=yield this.listVideoInputDevices();return e?e.find(e=>e.deviceId===t):null})}decodeFromInputVideoDevice(t,e){return B(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(t,e)})}decodeOnceFromVideoDevice(t,e){return B(this,void 0,void 0,function*(){let n;this.reset(),n=t?{deviceId:{exact:t}}:{facingMode:"environment"};const r={video:n};return yield this.decodeOnceFromConstraints(r,e)})}decodeOnceFromConstraints(t,e){return B(this,void 0,void 0,function*(){const n=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeOnceFromStream(n,e)})}decodeOnceFromStream(t,e){return B(this,void 0,void 0,function*(){this.reset();const n=yield this.attachStreamToVideo(t,e);return yield this.decodeOnce(n)})}decodeFromInputVideoDeviceContinuously(t,e,n){return B(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(t,e,n)})}decodeFromVideoDevice(t,e,n){return B(this,void 0,void 0,function*(){let r;r=t?{deviceId:{exact:t}}:{facingMode:"environment"};const o={video:r};return yield this.decodeFromConstraints(o,e,n)})}decodeFromConstraints(t,e,n){return B(this,void 0,void 0,function*(){const r=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeFromStream(r,e,n)})}decodeFromStream(t,e,n){return B(this,void 0,void 0,function*(){this.reset();const r=yield this.attachStreamToVideo(t,e);return yield this.decodeContinuously(r,n)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(t,e){return B(this,void 0,void 0,function*(){const n=this.prepareVideoElement(e);return this.addVideoSource(n,t),this.videoElement=n,this.stream=t,yield this.playVideoOnLoadAsync(n),n})}playVideoOnLoadAsync(t){return new Promise((e,n)=>this.playVideoOnLoad(t,()=>e()))}playVideoOnLoad(t,e){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(t),t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)}isVideoPlaying(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2}tryPlayVideo(t){return B(this,void 0,void 0,function*(){if(this.isVideoPlaying(t))console.warn("Trying to play video that is already playing.");else try{yield t.play()}catch(t){console.warn("It was not possible to play the video.")}})}getMediaElement(t,e){const n=document.getElementById(t);if(!n)throw new l(`element with id '${t}' not found`);if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new l(`element with id '${t}' must be an ${e} element`);return n}decodeFromImage(t,e){if(!t&&!e)throw new l("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)}decodeFromVideo(t,e){if(!t&&!e)throw new l("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)}decodeFromVideoContinuously(t,e,n){if(void 0===t&&void 0===e)throw new l("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)}decodeFromImageElement(t){if(!t)throw new l("An image element must be provided.");this.reset();const e=this.prepareImageElement(t);let n;return this.imageElement=e,n=this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e),n}decodeFromVideoElement(t){const e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)}decodeFromVideoElementContinuously(t,e){const n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)}_decodeFromVideoElementSetup(t){if(!t)throw new l("A video element must be provided.");this.reset();const e=this.prepareVideoElement(t);return this.videoElement=e,e}decodeFromImageUrl(t){if(!t)throw new l("An URL must be provided.");this.reset();const e=this.prepareImageElement();this.imageElement=e;const n=this._decodeOnLoadImage(e);return e.src=t,n}decodeFromVideoUrl(t){if(!t)throw new l("An URL must be provided.");this.reset();const e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n}decodeFromVideoUrlContinuously(t,e){if(!t)throw new l("An URL must be provided.");this.reset();const n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,e);return n.src=t,r}_decodeOnLoadImage(t){return new Promise((e,n)=>{this.imageLoadedListener=()=>this.decodeOnce(t,!1,!0).then(e,n),t.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(t){return B(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(t),yield this.decodeOnce(t)})}_decodeOnLoadVideoContinuously(t,e){return B(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(t),this.decodeContinuously(t,e)})}isImageLoaded(t){return!!t.complete&&0!==t.naturalWidth}prepareImageElement(t){let e;return void 0===t&&(e=document.createElement("img"),e.width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e}prepareVideoElement(t){let e;return t||"undefined"==typeof document||(e=document.createElement("video"),e.width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e}decodeOnce(t,e=!0,n=!0){this._stopAsyncDecode=!1;const r=(o,i)=>{if(this._stopAsyncDecode)return i(new T("Video stream has ended before any code could be detected.")),void(this._stopAsyncDecode=void 0);try{o(this.decode(t))}catch(t){if(e&&t instanceof T||(t instanceof h||t instanceof v)&&n)return setTimeout(r,this._timeBetweenDecodingAttempts,o,i);i(t)}};return new Promise((t,e)=>r(t,e))}decodeContinuously(t,e){this._stopContinuousDecode=!1;const n=()=>{if(this._stopContinuousDecode)this._stopContinuousDecode=void 0;else try{const r=this.decode(t);e(r,null),setTimeout(n,this.timeBetweenScansMillis)}catch(t){e(null,t),(t instanceof h||t instanceof v||t instanceof T)&&setTimeout(n,this._timeBetweenDecodingAttempts)}};n()}decode(t){const e=this.createBinaryBitmap(t);return this.decodeBitmap(e)}_isHTMLVideoElement(t){return 0!==t.videoWidth}drawFrameOnCanvas(t,e,n){e||(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n||(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}drawImageOnCanvas(t,e,n=this.captureCanvasContext){e||(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n||(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}createBinaryBitmap(t){this.getCaptureCanvasContext(t),this._isHTMLVideoElement(t)?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);const e=this.getCaptureCanvas(t),n=new O(e),r=new N(n);return new u(r)}getCaptureCanvasContext(t){if(!this.captureCanvasContext){const e=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=e}return this.captureCanvasContext}getCaptureCanvas(t){if(!this.captureCanvas){const e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas}decodeBitmap(t){return this.reader.decode(t,this._hints)}createCaptureCanvas(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;const e=document.createElement("canvas");let n,r;return void 0!==t&&(t instanceof HTMLVideoElement?(n=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=r+"px",e.width=n,e.height=r,e}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(t=>t.stop()),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(t,e){try{t.srcObject=e}catch(n){t.src=URL.createObjectURL(e)}}cleanVideoSource(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")}}class L{constructor(t,e,n=(null==e?0:8*e.length),r,o,i=f.currentTimeMillis()){this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=r,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,this.numBits=null==n?null==e?0:8*e.length:n,this.resultPoints=r,this.format=o,this.resultMetadata=null,this.timestamp=null==i?f.currentTimeMillis():i}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)}putAllMetadata(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))}addResultPoints(t){const e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){const n=new Array(e.length+t.length);f.arraycopy(e,0,n,0,e.length),f.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}}getTimestamp(){return this.timestamp}toString(){return this.text}}!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(P||(P={}));var q,V=P;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(q||(q={}));var H,U,z,W,j,G,X=q;class Q{constructor(t,e,n,r,o=-1,i=-1){this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(t){this.numBits=t}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(t){this.errorsCorrected=t}getErasures(){return this.erasures}setErasures(t){this.erasures=t}getOther(){return this.other}setOther(t){this.other=t}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Y{exp(t){return this.expTable[t]}log(t){if(0===t)throw new d;return this.logTable[t]}static addOrSubtract(t,e){return t^e}}class Z{constructor(t,e){if(0===e.length)throw new d;this.field=t;const n=e.length;if(n>1&&0===e[0]){let t=1;for(;t<n&&0===e[t];)t++;t===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-t),f.arraycopy(e,t,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(0===t)return this.getCoefficient(0);const e=this.coefficients;let n;if(1===t){n=0;for(let t=0,r=e.length;t!==r;t++){const r=e[t];n=Y.addOrSubtract(n,r)}return n}n=e[0];const r=e.length,o=this.field;for(let i=1;i<r;i++)n=Y.addOrSubtract(o.multiply(t,n),e[i]);return n}addOrSubtract(t){if(!this.field.equals(t.field))throw new d("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;let e=this.coefficients,n=t.coefficients;if(e.length>n.length){const t=e;e=n,n=t}let r=new Int32Array(n.length);const o=n.length-e.length;f.arraycopy(n,0,r,0,o);for(let t=o;t<n.length;t++)r[t]=Y.addOrSubtract(e[t-o],n[t]);return new Z(this.field,r)}multiply(t){if(!this.field.equals(t.field))throw new d("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();const e=this.coefficients,n=e.length,r=t.coefficients,o=r.length,i=new Int32Array(n+o-1),a=this.field;for(let t=0;t<n;t++){const n=e[t];for(let e=0;e<o;e++)i[t+e]=Y.addOrSubtract(i[t+e],a.multiply(n,r[e]))}return new Z(a,i)}multiplyScalar(t){if(0===t)return this.field.getZero();if(1===t)return this;const e=this.coefficients.length,n=this.field,r=new Int32Array(e),o=this.coefficients;for(let i=0;i<e;i++)r[i]=n.multiply(o[i],t);return new Z(n,r)}multiplyByMonomial(t,e){if(t<0)throw new d;if(0===e)return this.field.getZero();const n=this.coefficients,r=n.length,o=new Int32Array(r+t),i=this.field;for(let t=0;t<r;t++)o[t]=i.multiply(n[t],e);return new Z(i,o)}divide(t){if(!this.field.equals(t.field))throw new d("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new d("Divide by 0");const e=this.field;let n=e.getZero(),r=this;const o=t.getCoefficient(t.getDegree()),i=e.inverse(o);for(;r.getDegree()>=t.getDegree()&&!r.isZero();){const o=r.getDegree()-t.getDegree(),a=e.multiply(r.getCoefficient(r.getDegree()),i),s=t.multiplyByMonomial(o,a),c=e.buildMonomial(o,a);n=n.addOrSubtract(c),r=r.addOrSubtract(s)}return[n,r]}toString(){let t="";for(let e=this.getDegree();e>=0;e--){let n=this.getCoefficient(e);if(0!==n){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),0===e||1!==n){const e=this.field.log(n);0===e?t+="1":1===e?t+="a":(t+="a^",t+=e)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t}}class K extends c{}K.kind="ArithmeticException";class J extends Y{constructor(t,e,n){super(),this.primitive=t,this.size=e,this.generatorBase=n;const r=new Int32Array(e);let o=1;for(let n=0;n<e;n++)r[n]=o,o*=2,o>=e&&(o^=t,o&=e-1);this.expTable=r;const i=new Int32Array(e);for(let t=0;t<e-1;t++)i[r[t]]=t;this.logTable=i,this.zero=new Z(this,Int32Array.from([0])),this.one=new Z(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,e){if(t<0)throw new d;if(0===e)return this.zero;const n=new Int32Array(t+1);return n[0]=e,new Z(this,n)}inverse(t){if(0===t)throw new K;return this.expTable[this.size-this.logTable[t]-1]}multiply(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+w.toHexString(this.primitive)+","+this.size+")"}equals(t){return t===this}}J.AZTEC_DATA_12=new J(4201,4096,1),J.AZTEC_DATA_10=new J(1033,1024,1),J.AZTEC_DATA_6=new J(67,64,1),J.AZTEC_PARAM=new J(19,16,1),J.QR_CODE_FIELD_256=new J(285,256,0),J.DATA_MATRIX_FIELD_256=new J(301,256,1),J.AZTEC_DATA_8=J.DATA_MATRIX_FIELD_256,J.MAXICODE_FIELD_64=J.AZTEC_DATA_6;class tt extends c{}tt.kind="ReedSolomonException";class et extends c{}et.kind="IllegalStateException";class nt{constructor(t){this.field=t}decode(t,e){const n=this.field,r=new Z(n,t),o=new Int32Array(e);let i=!0;for(let t=0;t<e;t++){const e=r.evaluateAt(n.exp(t+n.getGeneratorBase()));o[o.length-1-t]=e,0!==e&&(i=!1)}if(i)return;const a=new Z(n,o),s=this.runEuclideanAlgorithm(n.buildMonomial(e,1),a,e),c=s[0],l=s[1],d=this.findErrorLocations(c),u=this.findErrorMagnitudes(l,d);for(let e=0;e<d.length;e++){const r=t.length-1-n.log(d[e]);if(r<0)throw new tt("Bad error location");t[r]=J.addOrSubtract(t[r],u[e])}}runEuclideanAlgorithm(t,e,n){if(t.getDegree()<e.getDegree()){const n=t;t=e,e=n}const r=this.field;let o=t,i=e,a=r.getZero(),s=r.getOne();for(;i.getDegree()>=(n/2|0);){let t=o,e=a;if(o=i,a=s,o.isZero())throw new tt("r_{i-1} was zero");i=t;let n=r.getZero();const c=o.getCoefficient(o.getDegree()),l=r.inverse(c);for(;i.getDegree()>=o.getDegree()&&!i.isZero();){const t=i.getDegree()-o.getDegree(),e=r.multiply(i.getCoefficient(i.getDegree()),l);n=n.addOrSubtract(r.buildMonomial(t,e)),i=i.addOrSubtract(o.multiplyByMonomial(t,e))}if(s=n.multiply(a).addOrSubtract(e),i.getDegree()>=o.getDegree())throw new et("Division algorithm failed to reduce polynomial?")}const c=s.getCoefficient(0);if(0===c)throw new tt("sigmaTilde(0) was zero");const l=r.inverse(c);return[s.multiplyScalar(l),i.multiplyScalar(l)]}findErrorLocations(t){const e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);const n=new Int32Array(e);let r=0;const o=this.field;for(let i=1;i<o.getSize()&&r<e;i++)0===t.evaluateAt(i)&&(n[r]=o.inverse(i),r++);if(r!==e)throw new tt("Error locator degree does not match number of roots");return n}findErrorMagnitudes(t,e){const n=e.length,r=new Int32Array(n),o=this.field;for(let i=0;i<n;i++){const a=o.inverse(e[i]);let s=1;for(let t=0;t<n;t++)if(i!==t){const n=o.multiply(e[t],a),r=1&n?-2&n:1|n;s=o.multiply(s,r)}r[i]=o.multiply(t.evaluateAt(a),o.inverse(s)),0!==o.getGeneratorBase()&&(r[i]=o.multiply(r[i],a))}return r}}!function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"}(H||(H={}));class rt{decode(t){this.ddata=t;let e=t.getBits(),n=this.extractBits(e),r=this.correctBits(n),o=rt.convertBoolArrayToByteArray(r),i=rt.getEncodedData(r),a=new Q(o,i,null,null);return a.setNumBits(r.length),a}static highLevelDecode(t){return this.getEncodedData(t)}static getEncodedData(t){let e=t.length,n=H.UPPER,r=H.UPPER,o="",i=0;for(;i<e;)if(r===H.BINARY){if(e-i<5)break;let a=rt.readCode(t,i,5);if(i+=5,0===a){if(e-i<11)break;a=rt.readCode(t,i,11)+31,i+=11}for(let n=0;n<a;n++){if(e-i<8){i=e;break}const n=rt.readCode(t,i,8);o+=A.castAsNonUtf8Char(n),i+=8}r=n}else{let a=r===H.DIGIT?4:5;if(e-i<a)break;let s=rt.readCode(t,i,a);i+=a;let c=rt.getCharacter(r,s);c.startsWith("CTRL_")?(n=r,r=rt.getTable(c.charAt(5)),"L"===c.charAt(6)&&(n=r)):(o+=c,r=n)}return o}static getTable(t){switch(t){case"L":return H.LOWER;case"P":return H.PUNCT;case"M":return H.MIXED;case"D":return H.DIGIT;case"B":return H.BINARY;default:return H.UPPER}}static getCharacter(t,e){switch(t){case H.UPPER:return rt.UPPER_TABLE[e];case H.LOWER:return rt.LOWER_TABLE[e];case H.MIXED:return rt.MIXED_TABLE[e];case H.PUNCT:return rt.PUNCT_TABLE[e];case H.DIGIT:return rt.DIGIT_TABLE[e];default:throw new et("Bad table")}}correctBits(t){let e,n;this.ddata.getNbLayers()<=2?(n=6,e=J.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=J.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=J.AZTEC_DATA_10):(n=12,e=J.AZTEC_DATA_12);let r=this.ddata.getNbDatablocks(),o=t.length/n;if(o<r)throw new v;let i=t.length%n,a=new Int32Array(o);for(let e=0;e<o;e++,i+=n)a[e]=rt.readCode(t,i,n);try{new nt(e).decode(a,o-r)}catch(t){throw new v(t)}let s=(1<<n)-1,c=0;for(let t=0;t<r;t++){let e=a[t];if(0===e||e===s)throw new v;1!==e&&e!==s-1||c++}let l=new Array(r*n-c),d=0;for(let t=0;t<r;t++){let e=a[t];if(1===e||e===s-1)l.fill(e>1,d,d+n-1),d+=n-1;else for(let t=n-1;t>=0;--t)l[d++]=!!(e&1<<t)}return l}extractBits(t){let e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(e?11:14)+4*n,o=new Int32Array(r),i=new Array(this.totalBitsInLayer(n,e));if(e)for(let t=0;t<o.length;t++)o[t]=t;else{let t=r+1+2*w.truncDivision(w.truncDivision(r,2)-1,15),e=r/2,n=w.truncDivision(t,2);for(let t=0;t<e;t++){let r=t+w.truncDivision(t,15);o[e-t-1]=n-r-1,o[e+t]=n+r+1}}for(let a=0,s=0;a<n;a++){let c=4*(n-a)+(e?9:12),l=2*a,d=r-1-l;for(let e=0;e<c;e++){let n=2*e;for(let r=0;r<2;r++)i[s+n+r]=t.get(o[l+r],o[l+e]),i[s+2*c+n+r]=t.get(o[l+e],o[d-r]),i[s+4*c+n+r]=t.get(o[d-r],o[d-e]),i[s+6*c+n+r]=t.get(o[d-e],o[l+r])}s+=8*c}return i}static readCode(t,e,n){let r=0;for(let o=e;o<e+n;o++)r<<=1,t[o]&&(r|=1);return r}static readByte(t,e){let n=t.length-e;return n>=8?rt.readCode(t,e,8):rt.readCode(t,e,n)<<8-n}static convertBoolArrayToByteArray(t){let e=new Uint8Array((t.length+7)/8);for(let n=0;n<e.length;n++)e[n]=rt.readByte(t,8*n);return e}totalBitsInLayer(t,e){return((e?88:112)+16*t)*t}}rt.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],rt.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],rt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","\t","\n","\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],rt.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],rt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class ot{constructor(){}static round(t){return NaN===t?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0}static distance(t,e,n,r){const o=t-n,i=e-r;return Math.sqrt(o*o+i*i)}static sum(t){let e=0;for(let n=0,r=t.length;n!==r;n++)e+=t[n];return e}}class it{static floatToIntBits(t){return t}}it.MAX_VALUE=Number.MAX_SAFE_INTEGER;class at{constructor(t,e){this.x=t,this.y=e}getX(){return this.x}getY(){return this.y}equals(t){if(t instanceof at){const e=t;return this.x===e.x&&this.y===e.y}return!1}hashCode(){return 31*it.floatToIntBits(this.x)+it.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(t){const e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),r=this.distance(t[0],t[2]);let o,i,a;if(n>=e&&n>=r?(i=t[0],o=t[1],a=t[2]):r>=n&&r>=e?(i=t[1],o=t[0],a=t[2]):(i=t[2],o=t[0],a=t[1]),this.crossProductZ(o,i,a)<0){const t=o;o=a,a=t}t[0]=o,t[1]=i,t[2]=a}static distance(t,e){return ot.distance(t.x,t.y,e.x,e.y)}static crossProductZ(t,e,n){const r=e.x,o=e.y;return(n.x-r)*(t.y-o)-(n.y-o)*(t.x-r)}}class st{constructor(t,e){this.bits=t,this.points=e}getBits(){return this.bits}getPoints(){return this.points}}class ct extends st{constructor(t,e,n,r,o){super(t,e),this.compact=n,this.nbDatablocks=r,this.nbLayers=o}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class lt{constructor(t,e,n,r){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),null==e&&(e=lt.INIT_SIZE),null==n&&(n=t.getWidth()/2|0),null==r&&(r=t.getHeight()/2|0);const o=e/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=r-o,this.downInit=r+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new T}detect(){let t=this.leftInit,e=this.rightInit,n=this.upInit,r=this.downInit,o=!1,i=!0,a=!1,s=!1,c=!1,l=!1,d=!1;const u=this.width,h=this.height;for(;i;){i=!1;let m=!0;for(;(m||!s)&&e<u;)m=this.containsBlackPoint(n,r,e,!1),m?(e++,i=!0,s=!0):s||e++;if(e>=u){o=!0;break}let f=!0;for(;(f||!c)&&r<h;)f=this.containsBlackPoint(t,e,r,!0),f?(r++,i=!0,c=!0):c||r++;if(r>=h){o=!0;break}let p=!0;for(;(p||!l)&&t>=0;)p=this.containsBlackPoint(n,r,t,!1),p?(t--,i=!0,l=!0):l||t--;if(t<0){o=!0;break}let _=!0;for(;(_||!d)&&n>=0;)_=this.containsBlackPoint(t,e,n,!0),_?(n--,i=!0,d=!0):d||n--;if(n<0){o=!0;break}i&&(a=!0)}if(!o&&a){const o=e-t;let i=null;for(let e=1;null===i&&e<o;e++)i=this.getBlackPointOnSegment(t,r-e,t+e,r);if(null==i)throw new T;let a=null;for(let e=1;null===a&&e<o;e++)a=this.getBlackPointOnSegment(t,n+e,t+e,n);if(null==a)throw new T;let s=null;for(let t=1;null===s&&t<o;t++)s=this.getBlackPointOnSegment(e,n+t,e-t,n);if(null==s)throw new T;let c=null;for(let t=1;null===c&&t<o;t++)c=this.getBlackPointOnSegment(e,r-t,e-t,r);if(null==c)throw new T;return this.centerEdges(c,i,s,a)}throw new T}getBlackPointOnSegment(t,e,n,r){const o=ot.round(ot.distance(t,e,n,r)),i=(n-t)/o,a=(r-e)/o,s=this.image;for(let n=0;n<o;n++){const r=ot.round(t+n*i),o=ot.round(e+n*a);if(s.get(r,o))return new at(r,o)}return null}centerEdges(t,e,n,r){const o=t.getX(),i=t.getY(),a=e.getX(),s=e.getY(),c=n.getX(),l=n.getY(),d=r.getX(),u=r.getY(),h=lt.CORR;return o<this.width/2?[new at(d-h,u+h),new at(a+h,s+h),new at(c-h,l-h),new at(o+h,i-h)]:[new at(d+h,u+h),new at(a+h,s-h),new at(c-h,l+h),new at(o-h,i-h)]}containsBlackPoint(t,e,n,r){const o=this.image;if(r){for(let r=t;r<=e;r++)if(o.get(r,n))return!0}else for(let r=t;r<=e;r++)if(o.get(n,r))return!0;return!1}}lt.INIT_SIZE=10,lt.CORR=1;class dt{static checkAndNudgePoints(t,e){const n=t.getWidth(),r=t.getHeight();let o=!0;for(let t=0;t<e.length&&o;t+=2){const i=Math.floor(e[t]),a=Math.floor(e[t+1]);if(i<-1||i>n||a<-1||a>r)throw new T;o=!1,-1===i?(e[t]=0,o=!0):i===n&&(e[t]=n-1,o=!0),-1===a?(e[t+1]=0,o=!0):a===r&&(e[t+1]=r-1,o=!0)}o=!0;for(let t=e.length-2;t>=0&&o;t-=2){const i=Math.floor(e[t]),a=Math.floor(e[t+1]);if(i<-1||i>n||a<-1||a>r)throw new T;o=!1,-1===i?(e[t]=0,o=!0):i===n&&(e[t]=n-1,o=!0),-1===a?(e[t+1]=0,o=!0):a===r&&(e[t+1]=r-1,o=!0)}}}class ut{constructor(t,e,n,r,o,i,a,s,c){this.a11=t,this.a21=e,this.a31=n,this.a12=r,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=c}static quadrilateralToQuadrilateral(t,e,n,r,o,i,a,s,c,l,d,u,h,m,f,p){const _=ut.quadrilateralToSquare(t,e,n,r,o,i,a,s);return ut.squareToQuadrilateral(c,l,d,u,h,m,f,p).times(_)}transformPoints(t){const e=t.length,n=this.a11,r=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,c=this.a31,l=this.a32,d=this.a33;for(let u=0;u<e;u+=2){const e=t[u],h=t[u+1],m=o*e+s*h+d;t[u]=(n*e+i*h+c)/m,t[u+1]=(r*e+a*h+l)/m}}transformPointsWithValues(t,e){const n=this.a11,r=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,c=this.a31,l=this.a32,d=this.a33,u=t.length;for(let h=0;h<u;h++){const u=t[h],m=e[h],f=o*u+s*m+d;t[h]=(n*u+i*m+c)/f,e[h]=(r*u+a*m+l)/f}}static squareToQuadrilateral(t,e,n,r,o,i,a,s){const c=t-n+o-a,l=e-r+i-s;if(0===c&&0===l)return new ut(n-t,o-n,t,r-e,i-r,e,0,0,1);{const d=n-o,u=a-o,h=r-i,m=s-i,f=d*m-u*h,p=(c*m-u*l)/f,_=(d*l-c*h)/f;return new ut(n-t+p*n,a-t+_*a,t,r-e+p*r,s-e+_*s,e,p,_,1)}}static quadrilateralToSquare(t,e,n,r,o,i,a,s){return ut.squareToQuadrilateral(t,e,n,r,o,i,a,s).buildAdjoint()}buildAdjoint(){return new ut(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(t){return new ut(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)}}class ht extends dt{sampleGrid(t,e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w){const $=ut.quadrilateralToQuadrilateral(r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w);return this.sampleGridWithTransform(t,e,n,$)}sampleGridWithTransform(t,e,n,r){if(e<=0||n<=0)throw new T;const o=new k(e,n),i=new Float32Array(2*e);for(let e=0;e<n;e++){const n=i.length,a=e+.5;for(let t=0;t<n;t+=2)i[t]=t/2+.5,i[t+1]=a;r.transformPoints(i),dt.checkAndNudgePoints(t,i);try{for(let r=0;r<n;r+=2)t.get(Math.floor(i[r]),Math.floor(i[r+1]))&&o.set(r/2,e)}catch(t){throw new T}}return o}}class mt{static setGridSampler(t){mt.gridSampler=t}static getInstance(){return mt.gridSampler}}mt.gridSampler=new ht;class ft{constructor(t,e){this.x=t,this.y=e}toResultPoint(){return new at(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class pt{constructor(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}detect(){return this.detectMirror(!1)}detectMirror(t){let e=this.getMatrixCenter(),n=this.getBullsEyeCorners(e);if(t){let t=n[0];n[0]=n[2],n[2]=t}this.extractParameters(n);let r=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),o=this.getMatrixCornerPoints(n);return new ct(r,o,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(t){if(!(this.isValidPoint(t[0])&&this.isValidPoint(t[1])&&this.isValidPoint(t[2])&&this.isValidPoint(t[3])))throw new T;let e=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(n,e);let r=0;for(let t=0;t<4;t++){let e=n[(this.shift+t)%4];this.compact?(r<<=7,r+=e>>1&127):(r<<=10,r+=(e>>2&992)+(e>>1&31))}let o=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=1+(o>>6),this.nbDataBlocks=1+(63&o)):(this.nbLayers=1+(o>>11),this.nbDataBlocks=1+(2047&o))}getRotation(t,e){let n=0;t.forEach((t,r,o)=>{n=(t>>e-2<<1)+(1&t)+(n<<3)}),n=((1&n)<<11)+(n>>1);for(let t=0;t<4;t++)if(w.bitCount(n^this.EXPECTED_CORNER_BITS[t])<=2)return t;throw new T}getCorrectedParameterData(t,e){let n,r;e?(n=7,r=2):(n=10,r=4);let o=n-r,i=new Int32Array(n);for(let e=n-1;e>=0;--e)i[e]=15&t,t>>=4;try{new nt(J.AZTEC_PARAM).decode(i,o)}catch(t){throw new T}let a=0;for(let t=0;t<r;t++)a=(a<<4)+i[t];return a}getBullsEyeCorners(t){let e=t,n=t,r=t,o=t,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let t=this.getFirstDifferent(e,i,1,-1),a=this.getFirstDifferent(n,i,1,1),s=this.getFirstDifferent(r,i,-1,1),c=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){let n=this.distancePoint(c,t)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(n<.75||n>1.25||!this.isWhiteOrBlackRectangle(t,a,s,c))break}e=t,n=a,r=s,o=c,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new T;this.compact=5===this.nbCenterLayers;let a=new at(e.getX()+.5,e.getY()-.5),s=new at(n.getX()+.5,n.getY()+.5),c=new at(r.getX()-.5,r.getY()+.5),l=new at(o.getX()-.5,o.getY()-.5);return this.expandSquare([a,s,c,l],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let t,e,n,r;try{let o=new lt(this.image).detect();t=o[0],e=o[1],n=o[2],r=o[3]}catch(o){let i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new ft(i+7,a-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new ft(i+7,a+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new ft(i-7,a+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new ft(i-7,a-7),!1,-1,-1).toResultPoint()}let o=ot.round((t.getX()+r.getX()+e.getX()+n.getX())/4),i=ot.round((t.getY()+r.getY()+e.getY()+n.getY())/4);try{let a=new lt(this.image,15,o,i).detect();t=a[0],e=a[1],n=a[2],r=a[3]}catch(a){t=this.getFirstDifferent(new ft(o+7,i-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new ft(o+7,i+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new ft(o-7,i+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new ft(o-7,i-7),!1,-1,-1).toResultPoint()}return o=ot.round((t.getX()+r.getX()+e.getX()+n.getX())/4),i=ot.round((t.getY()+r.getY()+e.getY()+n.getY())/4),new ft(o,i)}getMatrixCornerPoints(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())}sampleGrid(t,e,n,r,o){let i=mt.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,c=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,c,s,c,c,s,c,e.getX(),e.getY(),n.getX(),n.getY(),r.getX(),r.getY(),o.getX(),o.getY())}sampleLine(t,e,n){let r=0,o=this.distanceResultPoint(t,e),i=o/n,a=t.getX(),s=t.getY(),c=i*(e.getX()-t.getX())/o,l=i*(e.getY()-t.getY())/o;for(let t=0;t<n;t++)this.image.get(ot.round(a+t*c),ot.round(s+t*l))&&(r|=1<<n-t-1);return r}isWhiteOrBlackRectangle(t,e,n,r){let o=3;t=new ft(t.getX()-o,t.getY()+o),e=new ft(e.getX()-o,e.getY()-o),n=new ft(n.getX()+o,n.getY()-o),r=new ft(r.getX()+o,r.getY()+o);let i=this.getColor(r,t);if(0===i)return!1;let a=this.getColor(t,e);return a===i&&(a=this.getColor(e,n),a===i&&(a=this.getColor(n,r),a===i))}getColor(t,e){let n=this.distancePoint(t,e),r=(e.getX()-t.getX())/n,o=(e.getY()-t.getY())/n,i=0,a=t.getX(),s=t.getY(),c=this.image.get(t.getX(),t.getY()),l=Math.ceil(n);for(let t=0;t<l;t++)a+=r,s+=o,this.image.get(ot.round(a),ot.round(s))!==c&&i++;let d=i/n;return d>.1&&d<.9?0:d<=.1===c?1:-1}getFirstDifferent(t,e,n,r){let o=t.getX()+n,i=t.getY()+r;for(;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=n,i+=r;for(o-=n,i-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=n;for(o-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=r;return i-=r,new ft(o,i)}expandSquare(t,e,n){let r=n/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,c=new at(a+r*o,s+r*i),l=new at(a-r*o,s-r*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),a=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2,[c,new at(a+r*o,s+r*i),l,new at(a-r*o,s-r*i)]}isValid(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()}isValidPoint(t){let e=ot.round(t.getX()),n=ot.round(t.getY());return this.isValid(e,n)}distancePoint(t,e){return ot.distance(t.getX(),t.getY(),e.getX(),e.getY())}distanceResultPoint(t,e){return ot.distance(t.getX(),t.getY(),e.getX(),e.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(w.truncDivision(this.nbLayers-4,8)+1)+15}}class _t{decode(t,e=null){let n=null,r=new pt(t.getBlackMatrix()),o=null,i=null;try{let t=r.detectMirror(!1);o=t.getPoints(),this.reportFoundResultPoints(e,o),i=(new rt).decode(t)}catch(t){n=t}if(null==i)try{let t=r.detectMirror(!0);o=t.getPoints(),this.reportFoundResultPoints(e,o),i=(new rt).decode(t)}catch(t){if(null!=n)throw n;throw t}let a=new L(i.getText(),i.getRawBytes(),i.getNumBits(),o,V.AZTEC,f.currentTimeMillis()),s=i.getByteSegments();null!=s&&a.putMetadata(X.BYTE_SEGMENTS,s);let c=i.getECLevel();return null!=c&&a.putMetadata(X.ERROR_CORRECTION_LEVEL,c),a}reportFoundResultPoints(t,e){if(null!=t){let n=t.get(b.NEED_RESULT_POINT_CALLBACK);null!=n&&e.forEach((t,e,r)=>{n.foundPossibleResultPoint(t)})}}reset(){}}class gt extends F{constructor(t=500){super(new _t,t)}}class wt{decode(t,e){try{return this.doDecode(t,e)}catch(n){if(e&&!0===e.get(b.TRY_HARDER)&&t.isRotateSupported()){const n=t.rotateCounterClockwise(),r=this.doDecode(n,e),o=r.getResultMetadata();let i=270;null!==o&&!0===o.get(X.ORIENTATION)&&(i+=o.get(X.ORIENTATION)%360),r.putMetadata(X.ORIENTATION,i);const a=r.getResultPoints();if(null!==a){const t=n.getHeight();for(let e=0;e<a.length;e++)a[e]=new at(t-a[e].getY()-1,a[e].getX())}return r}throw new T}}reset(){}doDecode(t,e){const n=t.getWidth(),r=t.getHeight();let o=new $(n);const i=e&&!0===e.get(b.TRY_HARDER),a=Math.max(1,r>>(i?8:5));let s;s=i?r:15;const c=Math.trunc(r/2);for(let i=0;i<s;i++){const s=Math.trunc((i+1)/2),l=c+a*(1&i?-s:s);if(l<0||l>=r)break;try{o=t.getBlackRow(l,o)}catch(t){continue}for(let t=0;t<2;t++){if(1===t&&(o.reverse(),e&&!0===e.get(b.NEED_RESULT_POINT_CALLBACK))){const t=new Map;e.forEach((e,n)=>t.set(n,e)),t.delete(b.NEED_RESULT_POINT_CALLBACK),e=t}try{const r=this.decodeRow(l,o,e);if(1===t){r.putMetadata(X.ORIENTATION,180);const t=r.getResultPoints();null!==t&&(t[0]=new at(n-t[0].getX()-1,t[0].getY()),t[1]=new at(n-t[1].getX()-1,t[1].getY()))}return r}catch(t){}}}throw new T}static recordPattern(t,e,n){const r=n.length;for(let t=0;t<r;t++)n[t]=0;const o=t.getSize();if(e>=o)throw new T;let i=!t.get(e),a=0,s=e;for(;s<o;){if(t.get(s)!==i)n[a]++;else{if(++a===r)break;n[a]=1,i=!i}s++}if(a!==r&&(a!==r-1||s!==o))throw new T}static recordPatternInReverse(t,e,n){let r=n.length,o=t.get(e);for(;e>0&&r>=0;)t.get(--e)!==o&&(r--,o=!o);if(r>=0)throw new T;wt.recordPattern(t,e+1,n)}static patternMatchVariance(t,e,n){const r=t.length;let o=0,i=0;for(let n=0;n<r;n++)o+=t[n],i+=e[n];if(o<i)return Number.POSITIVE_INFINITY;const a=o/i;n*=a;let s=0;for(let o=0;o<r;o++){const r=t[o],i=e[o]*a,c=r>i?r-i:i-r;if(c>n)return Number.POSITIVE_INFINITY;s+=c}return s/o}}class $t extends wt{static findStartPattern(t){const e=t.getSize(),n=t.getNextSet(0);let r=0,o=Int32Array.from([0,0,0,0,0,0]),i=n,a=!1;const s=6;for(let c=n;c<e;c++)if(t.get(c)!==a)o[r]++;else{if(r===s-1){let e=$t.MAX_AVG_VARIANCE,n=-1;for(let t=$t.CODE_START_A;t<=$t.CODE_START_C;t++){const r=wt.patternMatchVariance(o,$t.CODE_PATTERNS[t],$t.MAX_INDIVIDUAL_VARIANCE);r<e&&(e=r,n=t)}if(n>=0&&t.isRange(Math.max(0,i-(c-i)/2),i,!1))return Int32Array.from([i,c,n]);i+=o[0]+o[1],o=o.slice(2,o.length-1),o[r-1]=0,o[r]=0,r--}else r++;o[r]=1,a=!a}throw new T}static decodeCode(t,e,n){wt.recordPattern(t,n,e);let r=$t.MAX_AVG_VARIANCE,o=-1;for(let t=0;t<$t.CODE_PATTERNS.length;t++){const n=$t.CODE_PATTERNS[t],i=this.patternMatchVariance(e,n,$t.MAX_INDIVIDUAL_VARIANCE);i<r&&(r=i,o=t)}if(o>=0)return o;throw new T}decodeRow(t,e,n){const r=n&&!0===n.get(b.ASSUME_GS1),o=$t.findStartPattern(e),i=o[2];let a=0;const s=new Uint8Array(20);let c;switch(s[a++]=i,i){case $t.CODE_START_A:c=$t.CODE_CODE_A;break;case $t.CODE_START_B:c=$t.CODE_CODE_B;break;case $t.CODE_START_C:c=$t.CODE_CODE_C;break;default:throw new v}let l=!1,d=!1,u="",m=o[0],f=o[1];const p=Int32Array.from([0,0,0,0,0,0]);let _=0,g=0,w=i,$=0,y=!0,I=!1,C=!1;for(;!l;){const t=d;switch(d=!1,_=g,g=$t.decodeCode(e,p,f),s[a++]=g,g!==$t.CODE_STOP&&(y=!0),g!==$t.CODE_STOP&&($++,w+=$*g),m=f,f+=p.reduce((t,e)=>t+e,0),g){case $t.CODE_START_A:case $t.CODE_START_B:case $t.CODE_START_C:throw new v}switch(c){case $t.CODE_CODE_A:if(g<64)u+=C===I?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else if(g<96)u+=C===I?String.fromCharCode(g-64):String.fromCharCode(g+64),C=!1;else switch(g!==$t.CODE_STOP&&(y=!1),g){case $t.CODE_FNC_1:r&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case $t.CODE_FNC_2:case $t.CODE_FNC_3:break;case $t.CODE_FNC_4_A:!I&&C?(I=!0,C=!1):I&&C?(I=!1,C=!1):C=!0;break;case $t.CODE_SHIFT:d=!0,c=$t.CODE_CODE_B;break;case $t.CODE_CODE_B:c=$t.CODE_CODE_B;break;case $t.CODE_CODE_C:c=$t.CODE_CODE_C;break;case $t.CODE_STOP:l=!0}break;case $t.CODE_CODE_B:if(g<96)u+=C===I?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else switch(g!==$t.CODE_STOP&&(y=!1),g){case $t.CODE_FNC_1:r&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case $t.CODE_FNC_2:case $t.CODE_FNC_3:break;case $t.CODE_FNC_4_B:!I&&C?(I=!0,C=!1):I&&C?(I=!1,C=!1):C=!0;break;case $t.CODE_SHIFT:d=!0,c=$t.CODE_CODE_A;break;case $t.CODE_CODE_A:c=$t.CODE_CODE_A;break;case $t.CODE_CODE_C:c=$t.CODE_CODE_C;break;case $t.CODE_STOP:l=!0}break;case $t.CODE_CODE_C:if(g<100)g<10&&(u+="0"),u+=g;else switch(g!==$t.CODE_STOP&&(y=!1),g){case $t.CODE_FNC_1:r&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case $t.CODE_CODE_A:c=$t.CODE_CODE_A;break;case $t.CODE_CODE_B:c=$t.CODE_CODE_B;break;case $t.CODE_STOP:l=!0}}t&&(c=c===$t.CODE_CODE_A?$t.CODE_CODE_B:$t.CODE_CODE_A)}const E=f-m;if(f=e.getNextUnset(f),!e.isRange(f,Math.min(e.getSize(),f+(f-m)/2),!1))throw new T;if(w-=$*_,w%103!==_)throw new h;const A=u.length;if(0===A)throw new T;A>0&&y&&(u=c===$t.CODE_CODE_C?u.substring(0,A-2):u.substring(0,A-1));const S=(o[1]+o[0])/2,k=m+E/2,R=s.length,N=new Uint8Array(R);for(let t=0;t<R;t++)N[t]=s[t];const D=[new at(S,t),new at(k,t)];return new L(u,N,0,D,V.CODE_128,(new Date).getTime())}}$t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],$t.MAX_AVG_VARIANCE=.25,$t.MAX_INDIVIDUAL_VARIANCE=.7,$t.CODE_SHIFT=98,$t.CODE_CODE_C=99,$t.CODE_CODE_B=100,$t.CODE_CODE_A=101,$t.CODE_FNC_1=102,$t.CODE_FNC_2=97,$t.CODE_FNC_3=96,$t.CODE_FNC_4_A=101,$t.CODE_FNC_4_B=100,$t.CODE_START_A=103,$t.CODE_START_B=104,$t.CODE_START_C=105,$t.CODE_STOP=106;class yt extends wt{constructor(t=!1,e=!1){super(),this.usingCheckDigit=t,this.extendedMode=e,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(t,e,n){let r=this.counters;r.fill(0),this.decodeRowResult="";let o,i,a=yt.findAsteriskPattern(e,r),s=e.getNextSet(a[1]),c=e.getSize();do{yt.recordPattern(e,s,r);let t=yt.toNarrowWidePattern(r);if(t<0)throw new T;o=yt.patternToChar(t),this.decodeRowResult+=o,i=s;for(let t of r)s+=t;s=e.getNextSet(s)}while("*"!==o);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let l,d=0;for(let t of r)d+=t;if(s!==c&&2*(s-i-d)<d)throw new T;if(this.usingCheckDigit){let t=this.decodeRowResult.length-1,e=0;for(let n=0;n<t;n++)e+=yt.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(n));if(this.decodeRowResult.charAt(t)!==yt.ALPHABET_STRING.charAt(e%43))throw new h;this.decodeRowResult=this.decodeRowResult.substring(0,t)}if(0===this.decodeRowResult.length)throw new T;l=this.extendedMode?yt.decodeExtended(this.decodeRowResult):this.decodeRowResult;let u=(a[1]+a[0])/2,m=i+d/2;return new L(l,null,0,[new at(u,t),new at(m,t)],V.CODE_39,(new Date).getTime())}static findAsteriskPattern(t,e){let n=t.getSize(),r=t.getNextSet(0),o=0,i=r,a=!1,s=e.length;for(let c=r;c<n;c++)if(t.get(c)!==a)e[o]++;else{if(o===s-1){if(this.toNarrowWidePattern(e)===yt.ASTERISK_ENCODING&&t.isRange(Math.max(0,i-Math.floor((c-i)/2)),i,!1))return[i,c];i+=e[0]+e[1],e.copyWithin(0,2,2+o-1),e[o-1]=0,e[o]=0,o--}else o++;e[o]=1,a=!a}throw new T}static toNarrowWidePattern(t){let e,n=t.length,r=0;do{let o=2147483647;for(let e of t)e<o&&e>r&&(o=e);r=o,e=0;let i=0,a=0;for(let o=0;o<n;o++){let s=t[o];s>r&&(a|=1<<n-1-o,e++,i+=s)}if(3===e){for(let o=0;o<n&&e>0;o++){let n=t[o];if(n>r&&(e--,2*n>=i))return-1}return a}}while(e>3);return-1}static patternToChar(t){for(let e=0;e<yt.CHARACTER_ENCODINGS.length;e++)if(yt.CHARACTER_ENCODINGS[e]===t)return yt.ALPHABET_STRING.charAt(e);if(t===yt.ASTERISK_ENCODING)return"*";throw new T}static decodeExtended(t){let e=t.length,n="";for(let r=0;r<e;r++){let e=t.charAt(r);if("+"===e||"$"===e||"%"===e||"/"===e){let o=t.charAt(r+1),i="\0";switch(e){case"+":if(!(o>="A"&&o<="Z"))throw new v;i=String.fromCharCode(o.charCodeAt(0)+32);break;case"$":if(!(o>="A"&&o<="Z"))throw new v;i=String.fromCharCode(o.charCodeAt(0)-64);break;case"%":if(o>="A"&&o<="E")i=String.fromCharCode(o.charCodeAt(0)-38);else if(o>="F"&&o<="J")i=String.fromCharCode(o.charCodeAt(0)-11);else if(o>="K"&&o<="O")i=String.fromCharCode(o.charCodeAt(0)+16);else if(o>="P"&&o<="T")i=String.fromCharCode(o.charCodeAt(0)+43);else if("U"===o)i="\0";else if("V"===o)i="@";else if("W"===o)i="`";else{if("X"!==o&&"Y"!==o&&"Z"!==o)throw new v;i=""}break;case"/":if(o>="A"&&o<="O")i=String.fromCharCode(o.charCodeAt(0)-32);else{if("Z"!==o)throw new v;i=":"}}n+=i,r++}else n+=e}return n}}yt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",yt.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],yt.ASTERISK_ENCODING=148;class bt extends wt{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(t,e,n){let r=this.decodeStart(e),o=this.decodeEnd(e),i=new S;bt.decodeMiddle(e,r[1],o[0],i);let a=i.toString(),s=null;null!=n&&(s=n.get(b.ALLOWED_LENGTHS)),null==s&&(s=bt.DEFAULT_ALLOWED_LENGTHS);let c=a.length,l=!1,d=0;for(let t of s){if(c===t){l=!0;break}t>d&&(d=t)}if(!l&&c>d&&(l=!0),!l)throw new v;const u=[new at(r[1],t),new at(o[0],t)];return new L(a,null,0,u,V.ITF,(new Date).getTime())}static decodeMiddle(t,e,n,r){let o=new Int32Array(10),i=new Int32Array(5),a=new Int32Array(5);for(o.fill(0),i.fill(0),a.fill(0);e<n;){wt.recordPattern(t,e,o);for(let t=0;t<5;t++){let e=2*t;i[t]=o[e],a[t]=o[e+1]}let n=bt.decodeDigit(i);r.append(n.toString()),n=this.decodeDigit(a),r.append(n.toString()),o.forEach(function(t){e+=t})}}decodeStart(t){let e=bt.skipWhiteSpace(t),n=bt.findGuardPattern(t,e,bt.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n}validateQuietZone(t,e){let n=10*this.narrowLineWidth;n=n<e?n:e;for(let r=e-1;n>0&&r>=0&&!t.get(r);r--)n--;if(0!==n)throw new T}static skipWhiteSpace(t){const e=t.getSize(),n=t.getNextSet(0);if(n===e)throw new T;return n}decodeEnd(t){t.reverse();try{let e,n=bt.skipWhiteSpace(t);try{e=bt.findGuardPattern(t,n,bt.END_PATTERN_REVERSED[0])}catch(r){r instanceof T&&(e=bt.findGuardPattern(t,n,bt.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,e[0]);let r=e[0];return e[0]=t.getSize()-e[1],e[1]=t.getSize()-r,e}finally{t.reverse()}}static findGuardPattern(t,e,n){let r=n.length,o=new Int32Array(r),i=t.getSize(),a=!1,s=0,c=e;o.fill(0);for(let l=e;l<i;l++)if(t.get(l)!==a)o[s]++;else{if(s===r-1){if(wt.patternMatchVariance(o,n,bt.MAX_INDIVIDUAL_VARIANCE)<bt.MAX_AVG_VARIANCE)return[c,l];c+=o[0]+o[1],f.arraycopy(o,2,o,0,s-1),o[s-1]=0,o[s]=0,s--}else s++;o[s]=1,a=!a}throw new T}static decodeDigit(t){let e=bt.MAX_AVG_VARIANCE,n=-1,r=bt.PATTERNS.length;for(let o=0;o<r;o++){let r=bt.PATTERNS[o],i=wt.patternMatchVariance(t,r,bt.MAX_INDIVIDUAL_VARIANCE);i<e?(e=i,n=o):i===e&&(n=-1)}if(n>=0)return n%10;throw new T}}bt.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],bt.MAX_AVG_VARIANCE=.38,bt.MAX_INDIVIDUAL_VARIANCE=.5,bt.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],bt.START_PATTERN=Int32Array.from([1,1,1,1]),bt.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class vt extends wt{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(t){let e,n=!1,r=0,o=Int32Array.from([0,0,0]);for(;!n;){o=Int32Array.from([0,0,0]),e=vt.findGuardPattern(t,r,!1,this.START_END_PATTERN,o);let i=e[0];r=e[1];let a=i-(r-i);a>=0&&(n=t.isRange(a,i,!1))}return e}static checkChecksum(t){return vt.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(0===e)return!1;let n=parseInt(t.charAt(e-1),10);return vt.getStandardUPCEANChecksum(t.substring(0,e-1))===n}static getStandardUPCEANChecksum(t){let e=t.length,n=0;for(let r=e-1;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}n*=3;for(let r=e-2;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}return(1e3-n)%10}static decodeEnd(t,e){return vt.findGuardPattern(t,e,!1,vt.START_END_PATTERN,new Int32Array(vt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(t,e,n,r){return this.findGuardPattern(t,e,n,r,new Int32Array(r.length))}static findGuardPattern(t,e,n,r,o){let i=t.getSize(),a=0,s=e=n?t.getNextUnset(e):t.getNextSet(e),c=r.length,l=n;for(let n=e;n<i;n++)if(t.get(n)!==l)o[a]++;else{if(a===c-1){if(wt.patternMatchVariance(o,r,vt.MAX_INDIVIDUAL_VARIANCE)<vt.MAX_AVG_VARIANCE)return Int32Array.from([s,n]);s+=o[0]+o[1];let t=o.slice(2,o.length-1);for(let e=0;e<a-1;e++)o[e]=t[e];o[a-1]=0,o[a]=0,a--}else a++;o[a]=1,l=!l}throw new T}static decodeDigit(t,e,n,r){this.recordPattern(t,n,e);let o=this.MAX_AVG_VARIANCE,i=-1,a=r.length;for(let t=0;t<a;t++){let n=r[t],a=wt.patternMatchVariance(e,n,vt.MAX_INDIVIDUAL_VARIANCE);a<o&&(o=a,i=t)}if(i>=0)return i;throw new T}}vt.MAX_AVG_VARIANCE=.48,vt.MAX_INDIVIDUAL_VARIANCE=.7,vt.START_END_PATTERN=Int32Array.from([1,1,1]),vt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),vt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),vt.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class It{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,n){let r=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,r),i=r.toString(),a=It.parseExtensionString(i),s=[new at((n[0]+n[1])/2,t),new at(o,t)],c=new L(i,null,0,s,V.UPC_EAN_EXTENSION,(new Date).getTime());return null!=a&&c.putAllMetadata(a),c}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1],a=0;for(let e=0;e<5&&i<o;e++){let o=vt.decodeDigit(t,r,i,vt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<4-e),4!==e&&(i=t.getNextSet(i),i=t.getNextUnset(i))}if(5!==n.length)throw new T;let s=this.determineCheckDigit(a);if(It.extensionChecksum(n.toString())!==s)throw new T;return i}static extensionChecksum(t){let e=t.length,n=0;for(let r=e-2;r>=0;r-=2)n+=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(let r=e-1;r>=0;r-=2)n+=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10}determineCheckDigit(t){for(let e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new T}static parseExtensionString(t){if(5!==t.length)return null;let e=It.parseExtension5String(t);return null==e?null:new Map([[X.SUGGESTED_PRICE,e]])}static parseExtension5String(t){let e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}let n=parseInt(t.substring(1)),r=n%100;return e+(n/100).toString()+"."+(r<10?"0"+r:r.toString())}}class Ct{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,n){let r=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,r),i=r.toString(),a=Ct.parseExtensionString(i),s=[new at((n[0]+n[1])/2,t),new at(o,t)],c=new L(i,null,0,s,V.UPC_EAN_EXTENSION,(new Date).getTime());return null!=a&&c.putAllMetadata(a),c}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1],a=0;for(let e=0;e<2&&i<o;e++){let o=vt.decodeDigit(t,r,i,vt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<1-e),1!==e&&(i=t.getNextSet(i),i=t.getNextUnset(i))}if(2!==n.length)throw new T;if(parseInt(n.toString())%4!==a)throw new T;return i}static parseExtensionString(t){return 2!==t.length?null:new Map([[X.ISSUE_NUMBER,parseInt(t)]])}}class Et{static decodeRow(t,e,n){let r=vt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new It).decodeRow(t,e,r)}catch(n){return(new Ct).decodeRow(t,e,r)}}}Et.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class At extends vt{constructor(){super(),this.decodeRowStringBuffer="",At.L_AND_G_PATTERNS=At.L_PATTERNS.map(t=>Int32Array.from(t));for(let t=10;t<20;t++){let e=At.L_PATTERNS[t-10],n=new Int32Array(e.length);for(let t=0;t<e.length;t++)n[t]=e[e.length-t-1];At.L_AND_G_PATTERNS[t]=n}}decodeRow(t,e,n){let r=At.findStartGuardPattern(e),o=null==n?null:n.get(b.NEED_RESULT_POINT_CALLBACK);if(null!=o){const e=new at((r[0]+r[1])/2,t);o.foundPossibleResultPoint(e)}let i=this.decodeMiddle(e,r,this.decodeRowStringBuffer),a=i.rowOffset,s=i.resultString;if(null!=o){const e=new at(a,t);o.foundPossibleResultPoint(e)}let c=this.decodeEnd(e,a);if(null!=o){const e=new at((c[0]+c[1])/2,t);o.foundPossibleResultPoint(e)}let l=c[1],d=l+(l-c[0]);if(d>=e.getSize()||!e.isRange(l,d,!1))throw new T;let u=s.toString();if(u.length<8)throw new v;if(!At.checkChecksum(u))throw new h;let m=(r[1]+r[0])/2,f=(c[1]+c[0])/2,p=this.getBarcodeFormat(),_=[new at(m,t),new at(f,t)],g=new L(u,null,0,_,p,(new Date).getTime()),w=0;try{let n=Et.decodeRow(t,e,c[1]);g.putMetadata(X.UPC_EAN_EXTENSION,n.getText()),g.putAllMetadata(n.getResultMetadata()),g.addResultPoints(n.getResultPoints()),w=n.getText().length}catch(t){}let $=null==n?null:n.get(b.ALLOWED_EAN_EXTENSIONS);if(null!=$){let t=!1;for(let e in $)if(w.toString()===e){t=!0;break}if(!t)throw new T}return g}decodeEnd(t,e){return At.findGuardPattern(t,e,!1,At.START_END_PATTERN,new Int32Array(At.START_END_PATTERN.length).fill(0))}static checkChecksum(t){return At.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(0===e)return!1;let n=parseInt(t.charAt(e-1),10);return At.getStandardUPCEANChecksum(t.substring(0,e-1))===n}static getStandardUPCEANChecksum(t){let e=t.length,n=0;for(let r=e-1;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}n*=3;for(let r=e-2;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}return(1e3-n)%10}}class St extends At{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1],a=0;for(let e=0;e<6&&i<o;e++){let o=At.decodeDigit(t,r,i,At.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<5-e)}n=St.determineFirstDigit(n,a),i=At.findGuardPattern(t,i,!0,At.MIDDLE_PATTERN,new Int32Array(At.MIDDLE_PATTERN.length).fill(0))[1];for(let e=0;e<6&&i<o;e++){let e=At.decodeDigit(t,r,i,At.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+e);for(let t of r)i+=t}return{rowOffset:i,resultString:n}}getBarcodeFormat(){return V.EAN_13}static determineFirstDigit(t,e){for(let n=0;n<10;n++)if(e===this.FIRST_DIGIT_ENCODINGS[n])return t=String.fromCharCode("0".charCodeAt(0)+n)+t;throw new T}}St.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class kt extends At{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,e,n){const r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1];for(let e=0;e<4&&i<o;e++){let e=At.decodeDigit(t,r,i,At.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+e);for(let t of r)i+=t}i=At.findGuardPattern(t,i,!0,At.MIDDLE_PATTERN,new Int32Array(At.MIDDLE_PATTERN.length).fill(0))[1];for(let e=0;e<4&&i<o;e++){let e=At.decodeDigit(t,r,i,At.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+e);for(let t of r)i+=t}return{rowOffset:i,resultString:n}}getBarcodeFormat(){return V.EAN_8}}class Tt extends At{constructor(){super(...arguments),this.ean13Reader=new St}getBarcodeFormat(){return V.UPC_A}decode(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))}decodeRow(t,e,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,n))}decodeMiddle(t,e,n){return this.ean13Reader.decodeMiddle(t,e,n)}maybeReturnResult(t){let e=t.getText();if("0"===e.charAt(0)){let n=new L(e.substring(1),null,null,t.getResultPoints(),V.UPC_A);return null!=t.getResultMetadata()&&n.putAllMetadata(t.getResultMetadata()),n}throw new T}reset(){this.ean13Reader.reset()}}class Rt extends At{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(t,e,n){const r=this.decodeMiddleCounters.map(t=>t);r[0]=0,r[1]=0,r[2]=0,r[3]=0;const o=t.getSize();let i=e[1],a=0;for(let e=0;e<6&&i<o;e++){const o=Rt.decodeDigit(t,r,i,Rt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<5-e)}return{rowOffset:i,resultString:Rt.determineNumSysAndCheckDigit(n,a)}}decodeEnd(t,e){return Rt.findGuardPatternWithoutCounters(t,e,!0,Rt.MIDDLE_END_PATTERN)}checkChecksum(t){return At.checkChecksum(Rt.convertUPCEtoUPCA(t))}static determineNumSysAndCheckDigit(t,e){for(let n=0;n<=1;n++)for(let r=0;r<10;r++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r])return String.fromCharCode("0".charCodeAt(0)+n)+t+String.fromCharCode("0".charCodeAt(0)+r);throw T.getNotFoundInstance()}getBarcodeFormat(){return V.UPC_E}static convertUPCEtoUPCA(t){const e=t.slice(1,7).split("").map(t=>t.charCodeAt(0)),n=new S;n.append(t.charAt(0));let r=e[5];switch(r){case 0:case 1:case 2:n.appendChars(e,0,2),n.append(r),n.append("0000"),n.appendChars(e,2,3);break;case 3:n.appendChars(e,0,3),n.append("00000"),n.appendChars(e,3,2);break;case 4:n.appendChars(e,0,4),n.append("00000"),n.append(e[4]);break;default:n.appendChars(e,0,5),n.append("0000"),n.append(r)}return t.length>=8&&n.append(t.charAt(7)),n.toString()}}Rt.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Rt.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,26])];class Nt extends wt{constructor(t){super();let n=null==t?null:t.get(b.POSSIBLE_FORMATS),r=[];e(n)?(r.push(new St),r.push(new Tt),r.push(new kt),r.push(new Rt)):(n.indexOf(V.EAN_13)>-1&&r.push(new St),n.indexOf(V.UPC_A)>-1&&r.push(new Tt),n.indexOf(V.EAN_8)>-1&&r.push(new kt),n.indexOf(V.UPC_E)>-1&&r.push(new Rt)),this.readers=r}decodeRow(t,e,n){for(let r of this.readers)try{const o=r.decodeRow(t,e,n),i=o.getBarcodeFormat()===V.EAN_13&&"0"===o.getText().charAt(0),a=null==n?null:n.get(b.POSSIBLE_FORMATS),s=null==a||a.includes(V.UPC_A);if(i&&s){const t=o.getRawBytes(),e=new L(o.getText().substring(1),t,t?t.length:null,o.getResultPoints(),V.UPC_A);return e.putAllMetadata(o.getResultMetadata()),e}return o}catch(t){}throw new T}reset(){for(let t of this.readers)t.reset()}}class Dt extends wt{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(t,e){for(let n=0;n<e.length;n++)if(wt.patternMatchVariance(t,e[n],Dt.MAX_INDIVIDUAL_VARIANCE)<Dt.MAX_AVG_VARIANCE)return n;throw new T}static count(t){return ot.sum(new Int32Array(t))}static increment(t,e){let n=0,r=e[0];for(let o=1;o<t.length;o++)e[o]>r&&(r=e[o],n=o);t[n]++}static decrement(t,e){let n=0,r=e[0];for(let o=1;o<t.length;o++)e[o]<r&&(r=e[o],n=o);t[n]--}static isFinderPattern(t){let e=t[0]+t[1],n=e/(e+t[2]+t[3]);if(n>=Dt.MIN_FINDER_PATTERN_RATIO&&n<=Dt.MAX_FINDER_PATTERN_RATIO){let e=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER;for(let r of t)r>n&&(n=r),r<e&&(e=r);return n<10*e}return!1}}Dt.MAX_AVG_VARIANCE=.2,Dt.MAX_INDIVIDUAL_VARIANCE=.45,Dt.MIN_FINDER_PATTERN_RATIO=9.5/12,Dt.MAX_FINDER_PATTERN_RATIO=12.5/14;class xt{constructor(t,e){this.value=t,this.checksumPortion=e}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(t){if(!(t instanceof xt))return!1;const e=t;return this.value===e.value&&this.checksumPortion===e.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class Ot{constructor(t,e,n,r,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new at(n,o)),this.resultPoints.push(new at(r,o))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(t){if(!(t instanceof Ot))return!1;const e=t;return this.value===e.value}hashCode(){return this.value}}class Mt{constructor(){}static getRSSvalue(t,e,n){let r=0;for(let e of t)r+=e;let o=0,i=0,a=t.length;for(let s=0;s<a-1;s++){let c;for(c=1,i|=1<<s;c<t[s];c++,i&=~(1<<s)){let t=Mt.combins(r-c-1,a-s-2);if(n&&0===i&&r-c-(a-s-1)>=a-s-1&&(t-=Mt.combins(r-c-(a-s),a-s-2)),a-s-1>1){let n=0;for(let t=r-c-(a-s-2);t>e;t--)n+=Mt.combins(r-c-t-1,a-s-3);t-=n*(a-1-s)}else r-c>e&&t--;o+=t}r-=c}return o}static combins(t,e){let n,r;t-e>e?(r=e,n=t-e):(r=t-e,n=e);let o=1,i=1;for(let e=t;e>n;e--)o*=e,i<=r&&(o/=i,i++);for(;i<=r;)o/=i,i++;return o}}class Pt{static buildBitArray(t){let e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);let n=new $(12*e),r=0,o=t[0].getRightChar().getValue();for(let t=11;t>=0;--t)o&1<<t&&n.set(r),r++;for(let e=1;e<t.length;++e){let o=t[e],i=o.getLeftChar().getValue();for(let t=11;t>=0;--t)i&1<<t&&n.set(r),r++;if(null!=o.getRightChar()){let t=o.getRightChar().getValue();for(let e=11;e>=0;--e)t&1<<e&&n.set(r),r++}}return n}}class Bt{constructor(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class Ft{constructor(t){this.newPosition=t}getNewPosition(){return this.newPosition}}class Lt extends Ft{constructor(t,e){super(t),this.value=e}getValue(){return this.value}isFNC1(){return this.value===Lt.FNC1}}Lt.FNC1="$";class qt extends Ft{constructor(t,e,n){super(t),n?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=e}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class Vt extends Ft{constructor(t,e,n){if(super(t),e<0||e>10||n<0||n>10)throw new v;this.firstDigit=e,this.secondDigit=n}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return 10*this.firstDigit+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Vt.FNC1}isSecondDigitFNC1(){return this.secondDigit===Vt.FNC1}isAnyFNC1(){return this.firstDigit===Vt.FNC1||this.secondDigit===Vt.FNC1}}Vt.FNC1=10;class Ht{constructor(){}static parseFieldsInGeneralPurpose(t){if(!t)return null;if(t.length<2)throw new T;let e=t.substring(0,2);for(let n of Ht.TWO_DIGIT_DATA_LENGTH)if(n[0]===e)return n[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(2,n[2],t):Ht.processFixedAI(2,n[1],t);if(t.length<3)throw new T;let n=t.substring(0,3);for(let e of Ht.THREE_DIGIT_DATA_LENGTH)if(e[0]===n)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(3,e[2],t):Ht.processFixedAI(3,e[1],t);for(let e of Ht.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(e[0]===n)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(4,e[2],t):Ht.processFixedAI(4,e[1],t);if(t.length<4)throw new T;let r=t.substring(0,4);for(let e of Ht.FOUR_DIGIT_DATA_LENGTH)if(e[0]===r)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(4,e[2],t):Ht.processFixedAI(4,e[1],t);throw new T}static processFixedAI(t,e,n){if(n.length<t)throw new T;let r=n.substring(0,t);if(n.length<t+e)throw new T;let o=n.substring(t,t+e),i=n.substring(t+e),a="("+r+")"+o,s=Ht.parseFieldsInGeneralPurpose(i);return null==s?a:a+s}static processVariableAI(t,e,n){let r,o=n.substring(0,t);r=n.length<t+e?n.length:t+e;let i=n.substring(t,r),a=n.substring(r),s="("+o+")"+i,c=Ht.parseFieldsInGeneralPurpose(a);return null==c?s:s+c}}Ht.VARIABLE_LENGTH=[],Ht.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",Ht.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",Ht.VARIABLE_LENGTH,20],["22",Ht.VARIABLE_LENGTH,29],["30",Ht.VARIABLE_LENGTH,8],["37",Ht.VARIABLE_LENGTH,8],["90",Ht.VARIABLE_LENGTH,30],["91",Ht.VARIABLE_LENGTH,30],["92",Ht.VARIABLE_LENGTH,30],["93",Ht.VARIABLE_LENGTH,30],["94",Ht.VARIABLE_LENGTH,30],["95",Ht.VARIABLE_LENGTH,30],["96",Ht.VARIABLE_LENGTH,30],["97",Ht.VARIABLE_LENGTH,3],["98",Ht.VARIABLE_LENGTH,30],["99",Ht.VARIABLE_LENGTH,30]],Ht.THREE_DIGIT_DATA_LENGTH=[["240",Ht.VARIABLE_LENGTH,30],["241",Ht.VARIABLE_LENGTH,30],["242",Ht.VARIABLE_LENGTH,6],["250",Ht.VARIABLE_LENGTH,30],["251",Ht.VARIABLE_LENGTH,30],["253",Ht.VARIABLE_LENGTH,17],["254",Ht.VARIABLE_LENGTH,20],["400",Ht.VARIABLE_LENGTH,30],["401",Ht.VARIABLE_LENGTH,30],["402",17],["403",Ht.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",Ht.VARIABLE_LENGTH,20],["421",Ht.VARIABLE_LENGTH,15],["422",3],["423",Ht.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],Ht.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",Ht.VARIABLE_LENGTH,15],["391",Ht.VARIABLE_LENGTH,18],["392",Ht.VARIABLE_LENGTH,15],["393",Ht.VARIABLE_LENGTH,18],["703",Ht.VARIABLE_LENGTH,30]],Ht.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",Ht.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",Ht.VARIABLE_LENGTH,20],["8003",Ht.VARIABLE_LENGTH,30],["8004",Ht.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",Ht.VARIABLE_LENGTH,30],["8008",Ht.VARIABLE_LENGTH,12],["8018",18],["8020",Ht.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",Ht.VARIABLE_LENGTH,70],["8200",Ht.VARIABLE_LENGTH,70]];class Ut{constructor(t){this.buffer=new S,this.information=t}decodeAllCodes(t,e){let n=e,r=null;for(;;){let e=this.decodeGeneralPurposeField(n,r),o=Ht.parseFieldsInGeneralPurpose(e.getNewString());if(null!=o&&t.append(o),r=e.isRemaining()?""+e.getRemainingValue():null,n===e.getNewPosition())break;n=e.getNewPosition()}return t.toString()}isStillNumeric(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(let e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)}decodeNumeric(t){if(t+7>this.information.getSize()){let e=this.extractNumericValueFromBitArray(t,4);return new Vt(this.information.getSize(),0===e?Vt.FNC1:e-1,Vt.FNC1)}let e=this.extractNumericValueFromBitArray(t,7);return new Vt(t+7,(e-8)/11,(e-8)%11)}extractNumericValueFromBitArray(t,e){return Ut.extractNumericValueFromBitArray(this.information,t,e)}static extractNumericValueFromBitArray(t,e,n){let r=0;for(let o=0;o<n;++o)t.get(e+o)&&(r|=1<<n-o-1);return r}decodeGeneralPurposeField(t,e){this.buffer.setLengthToZero(),null!=e&&this.buffer.append(e),this.current.setPosition(t);let n=this.parseBlocks();return null!=n&&n.isRemaining()?new qt(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new qt(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let t,e;do{let n=this.current.getPosition();if(this.current.isAlpha()?(e=this.parseAlphaBlock(),t=e.isFinished()):this.current.isIsoIec646()?(e=this.parseIsoIec646Block(),t=e.isFinished()):(e=this.parseNumericBlock(),t=e.isFinished()),n===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){let e;return e=t.isSecondDigitFNC1()?new qt(this.current.getPosition(),this.buffer.toString()):new qt(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new Bt(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){let t=new qt(this.current.getPosition(),this.buffer.toString());return new Bt(!0,t)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Bt(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let t=new qt(this.current.getPosition(),this.buffer.toString());return new Bt(!0,t)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Bt(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let t=new qt(this.current.getPosition(),this.buffer.toString());return new Bt(!0,t)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Bt(!1)}isStillIsoIec646(t){if(t+5>this.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(t,8);return r>=232&&r<253}decodeIsoIec646(t){let e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Lt(t+5,Lt.FNC1);if(e>=5&&e<15)return new Lt(t+5,"0"+(e-5));let n,r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<90)return new Lt(t+7,""+(r+1));if(r>=90&&r<116)return new Lt(t+7,""+(r+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:n="!";break;case 233:n='"';break;case 234:n="%";break;case 235:n="&";break;case 236:n="'";break;case 237:n="(";break;case 238:n=")";break;case 239:n="*";break;case 240:n="+";break;case 241:n=",";break;case 242:n="-";break;case 243:n=".";break;case 244:n="/";break;case 245:n=":";break;case 246:n=";";break;case 247:n="<";break;case 248:n="=";break;case 249:n=">";break;case 250:n="?";break;case 251:n="_";break;case 252:n=" ";break;default:throw new v}return new Lt(t+8,n)}isStillAlpha(t){if(t+5>this.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63}decodeAlphanumeric(t){let e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Lt(t+5,Lt.FNC1);if(e>=5&&e<15)return new Lt(t+5,"0"+(e-5));let n,r=this.extractNumericValueFromBitArray(t,6);if(r>=32&&r<58)return new Lt(t+6,""+(r+33));switch(r){case 58:n="*";break;case 59:n=",";break;case 60:n="-";break;case 61:n=".";break;case 62:n="/";break;default:throw new et("Decoding invalid alphanumeric value: "+r)}return new Lt(t+6,n)}isAlphaTo646ToAlphaLatch(t){if(t+1>this.information.getSize())return!1;for(let e=0;e<5&&e+t<this.information.getSize();++e)if(2===e){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0}isAlphaOr646ToNumericLatch(t){if(t+3>this.information.getSize())return!1;for(let e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0}isNumericToAlphaNumericLatch(t){if(t+1>this.information.getSize())return!1;for(let e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0}}class zt{constructor(t){this.information=t,this.generalDecoder=new Ut(t)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Wt extends zt{constructor(t){super(t)}encodeCompressedGtin(t,e){t.append("(01)");let n=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,e,n)}encodeCompressedGtinWithoutAI(t,e,n){for(let n=0;n<4;++n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(e+10*n,10);r/100==0&&t.append("0"),r/10==0&&t.append("0"),t.append(r)}Wt.appendCheckDigit(t,n)}static appendCheckDigit(t,e){let n=0;for(let r=0;r<13;r++){let o=t.charAt(r+e).charCodeAt(0)-"0".charCodeAt(0);n+=1&r?o:3*o}n=10-n%10,10===n&&(n=0),t.append(n)}}Wt.GTIN_SIZE=40;class jt extends Wt{constructor(t){super(t)}parseInformation(){let t=new S;t.append("(01)");let e=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(jt.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,jt.HEADER_SIZE+4,e),this.getGeneralDecoder().decodeAllCodes(t,jt.HEADER_SIZE+44)}}jt.HEADER_SIZE=4;class Gt extends zt{constructor(t){super(t)}parseInformation(){let t=new S;return this.getGeneralDecoder().decodeAllCodes(t,Gt.HEADER_SIZE)}}Gt.HEADER_SIZE=5;class Xt extends Wt{constructor(t){super(t)}encodeCompressedWeight(t,e,n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(e,n);this.addWeightCode(t,r);let o=this.checkWeight(r),i=1e5;for(let e=0;e<5;++e)o/i===0&&t.append("0"),i/=10;t.append(o)}}class Qt extends Xt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()!=Qt.HEADER_SIZE+Xt.GTIN_SIZE+Qt.WEIGHT_SIZE)throw new T;let t=new S;return this.encodeCompressedGtin(t,Qt.HEADER_SIZE),this.encodeCompressedWeight(t,Qt.HEADER_SIZE+Xt.GTIN_SIZE,Qt.WEIGHT_SIZE),t.toString()}}Qt.HEADER_SIZE=5,Qt.WEIGHT_SIZE=15;class Yt extends Qt{constructor(t){super(t)}addWeightCode(t,e){t.append("(3103)")}checkWeight(t){return t}}class Zt extends Qt{constructor(t){super(t)}addWeightCode(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")}checkWeight(t){return t<1e4?t:t-1e4}}class Kt extends Wt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Kt.HEADER_SIZE+Wt.GTIN_SIZE)throw new T;let t=new S;this.encodeCompressedGtin(t,Kt.HEADER_SIZE);let e=this.getGeneralDecoder().extractNumericValueFromBitArray(Kt.HEADER_SIZE+Wt.GTIN_SIZE,Kt.LAST_DIGIT_SIZE);t.append("(392"),t.append(e),t.append(")");let n=this.getGeneralDecoder().decodeGeneralPurposeField(Kt.HEADER_SIZE+Wt.GTIN_SIZE+Kt.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()}}Kt.HEADER_SIZE=8,Kt.LAST_DIGIT_SIZE=2;class Jt extends Wt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Jt.HEADER_SIZE+Wt.GTIN_SIZE)throw new T;let t=new S;this.encodeCompressedGtin(t,Jt.HEADER_SIZE);let e=this.getGeneralDecoder().extractNumericValueFromBitArray(Jt.HEADER_SIZE+Wt.GTIN_SIZE,Jt.LAST_DIGIT_SIZE);t.append("(393"),t.append(e),t.append(")");let n=this.getGeneralDecoder().extractNumericValueFromBitArray(Jt.HEADER_SIZE+Wt.GTIN_SIZE+Jt.LAST_DIGIT_SIZE,Jt.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);let r=this.getGeneralDecoder().decodeGeneralPurposeField(Jt.HEADER_SIZE+Wt.GTIN_SIZE+Jt.LAST_DIGIT_SIZE+Jt.FIRST_THREE_DIGITS_SIZE,null);return t.append(r.getNewString()),t.toString()}}Jt.HEADER_SIZE=8,Jt.LAST_DIGIT_SIZE=2,Jt.FIRST_THREE_DIGITS_SIZE=10;class te extends Xt{constructor(t,e,n){super(t),this.dateCode=n,this.firstAIdigits=e}parseInformation(){if(this.getInformation().getSize()!=te.HEADER_SIZE+te.GTIN_SIZE+te.WEIGHT_SIZE+te.DATE_SIZE)throw new T;let t=new S;return this.encodeCompressedGtin(t,te.HEADER_SIZE),this.encodeCompressedWeight(t,te.HEADER_SIZE+te.GTIN_SIZE,te.WEIGHT_SIZE),this.encodeCompressedDate(t,te.HEADER_SIZE+te.GTIN_SIZE+te.WEIGHT_SIZE),t.toString()}encodeCompressedDate(t,e){let n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,te.DATE_SIZE);if(38400==n)return;t.append("("),t.append(this.dateCode),t.append(")");let r=n%32;n/=32;let o=n%12+1;n/=12;let i=n;i/10==0&&t.append("0"),t.append(i),o/10==0&&t.append("0"),t.append(o),r/10==0&&t.append("0"),t.append(r)}addWeightCode(t,e){t.append("("),t.append(this.firstAIdigits),t.append(e/1e5),t.append(")")}checkWeight(t){return t%1e5}}function ee(t){try{if(t.get(1))return new jt(t);if(!t.get(2))return new Gt(t);switch(Ut.extractNumericValueFromBitArray(t,1,4)){case 4:return new Yt(t);case 5:return new Zt(t)}switch(Ut.extractNumericValueFromBitArray(t,1,5)){case 12:return new Kt(t);case 13:return new Jt(t)}switch(Ut.extractNumericValueFromBitArray(t,1,7)){case 56:return new te(t,"310","11");case 57:return new te(t,"320","11");case 58:return new te(t,"310","13");case 59:return new te(t,"320","13");case 60:return new te(t,"310","15");case 61:return new te(t,"320","15");case 62:return new te(t,"310","17");case 63:return new te(t,"320","17")}}catch(e){throw console.log(e),new et("unknown decoder: "+t)}}te.HEADER_SIZE=8,te.WEIGHT_SIZE=20,te.DATE_SIZE=16;class ne{constructor(t,e,n,r){this.leftchar=t,this.rightchar=e,this.finderpattern=n,this.maybeLast=r}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return null==this.rightchar}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"}static equals(t,e){return t instanceof ne&&ne.equalsOrNull(t.leftchar,e.leftchar)&&ne.equalsOrNull(t.rightchar,e.rightchar)&&ne.equalsOrNull(t.finderpattern,e.finderpattern)}static equalsOrNull(t,e){return null===t?null===e:ne.equals(t,e)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class re{constructor(t,e,n){this.pairs=t,this.rowNumber=e,this.wasReversed=n}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(t){return this.checkEqualitity(this,t)}toString(){return"{ "+this.pairs+" }"}equals(t,e){return t instanceof re&&this.checkEqualitity(t,e)&&t.wasReversed===e.wasReversed}checkEqualitity(t,e){if(!t||!e)return;let n;return t.forEach((t,r)=>{e.forEach(e=>{t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(n=!0)})}),n}}class oe extends Dt{constructor(t){super(...arguments),this.pairs=new Array(oe.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=!0===t}decodeRow(t,e,n){this.pairs.length=0,this.startFromEven=!1;try{return oe.constructResult(this.decodeRow2pairs(t,e))}catch(t){this.verbose&&console.log(t)}return this.pairs.length=0,this.startFromEven=!0,oe.constructResult(this.decodeRow2pairs(t,e))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(t,e){let n,r=!1;for(;!r;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(t){if(t instanceof T){if(!this.pairs.length)throw new T;r=!0}}if(this.checkChecksum())return this.pairs;if(n=!!this.rows.length,this.storeRow(t,!1),n){let t=this.checkRowsBoolean(!1);if(null!=t)return t;if(t=this.checkRowsBoolean(!0),null!=t)return t}throw new T}checkRowsBoolean(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());let e=null;try{e=this.checkRows(new Array,0)}catch(t){this.verbose&&console.log(t)}return t&&(this.rows=this.rows.reverse()),e}checkRows(t,e){for(let n=e;n<this.rows.length;n++){let e=this.rows[n];this.pairs.length=0;for(let e of t)this.pairs.push(e.getPairs());if(this.pairs.push(e.getPairs()),!oe.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let r=new Array(t);r.push(e);try{return this.checkRows(r,n+1)}catch(t){this.verbose&&console.log(t)}}throw new T}static isValidSequence(t){for(let e of oe.FINDER_PATTERN_SEQUENCES){if(t.length>e.length)continue;let n=!0;for(let r=0;r<t.length;r++)if(t[r].getFinderPattern().getValue()!=e[r]){n=!1;break}if(n)return!0}return!1}storeRow(t,e){let n=0,r=!1,o=!1;for(;n<this.rows.length;){let e=this.rows[n];if(e.getRowNumber()>t){o=e.isEquivalent(this.pairs);break}r=e.isEquivalent(this.pairs),n++}o||r||oe.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new re(this.pairs,t,e)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(t,e){for(let n of e)if(n.getPairs().length!==t.length)for(let e of n.getPairs())for(let n of t)if(ne.equals(e,n))break}static isPartialRow(t,e){for(let n of e){let e=!0;for(let r of t){let t=!1;for(let e of n.getPairs())if(r.equals(e)){t=!0;break}if(!t){e=!1;break}}if(e)return!0}return!1}getRows(){return this.rows}static constructResult(t){let e=ee(Pt.buildBitArray(t)).parseInformation(),n=t[0].getFinderPattern().getResultPoints(),r=t[t.length-1].getFinderPattern().getResultPoints(),o=[n[0],n[1],r[0],r[1]];return new L(e,null,null,o,V.RSS_EXPANDED,null)}checkChecksum(){let t=this.pairs.get(0),e=t.getLeftChar(),n=t.getRightChar();if(null==n)return!1;let r=n.getChecksumPortion(),o=2;for(let t=1;t<this.pairs.size();++t){let e=this.pairs.get(t);r+=e.getLeftChar().getChecksumPortion(),o++;let n=e.getRightChar();null!=n&&(r+=n.getChecksumPortion(),o++)}return r%=211,211*(o-4)+r==e.getValue()}static getNextSecondBar(t,e){let n;return t.get(e)?(n=t.getNextUnset(e),n=t.getNextSet(n)):(n=t.getNextSet(e),n=t.getNextUnset(n)),n}retrieveNextPair(t,e,n){let r,o=e.length%2==0;this.startFromEven&&(o=!o);let i=!0,a=-1;do{this.findNextPair(t,e,a),r=this.parseFoundFinderPattern(t,n,o),null==r?a=oe.getNextSecondBar(t,this.startEnd[0]):i=!1}while(i);let s,c=this.decodeDataCharacter(t,r,o,!0);if(!this.isEmptyPair(e)&&e[e.length-1].mustBeLast())throw new T;try{s=this.decodeDataCharacter(t,r,o,!1)}catch(t){s=null,this.verbose&&console.log(t)}return new ne(c,s,r,!0)}isEmptyPair(t){return 0===t.length}findNextPair(t,e,n){let r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o,i=t.getSize();o=n>=0?n:this.isEmptyPair(e)?0:e[e.length-1].getFinderPattern().getStartEnd()[1];let a=e.length%2!=0;this.startFromEven&&(a=!a);let s=!1;for(;o<i&&(s=!t.get(o),s);)o++;let c=0,l=o;for(let e=o;e<i;e++)if(t.get(e)!=s)r[c]++;else{if(3==c){if(a&&oe.reverseCounters(r),oe.isFinderPattern(r))return this.startEnd[0]=l,void(this.startEnd[1]=e);a&&oe.reverseCounters(r),l+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,c--}else c++;r[c]=1,s=!s}throw new T}static reverseCounters(t){let e=t.length;for(let n=0;n<e/2;++n){let r=t[n];t[n]=t[e-n-1],t[e-n-1]=r}}parseFoundFinderPattern(t,e,n){let r,o,i;if(n){let e=this.startEnd[0]-1;for(;e>=0&&!t.get(e);)e--;e++,r=this.startEnd[0]-e,o=e,i=this.startEnd[1]}else o=this.startEnd[0],i=t.getNextUnset(this.startEnd[1]+1),r=i-this.startEnd[1];let a,s=this.getDecodeFinderCounters();f.arraycopy(s,0,s,1,s.length-1),s[0]=r;try{a=this.parseFinderValue(s,oe.FINDER_PATTERNS)}catch(t){return null}return new Ot(a,[o,i],o,i,e)}decodeDataCharacter(t,e,n,r){let o=this.getDataCharacterCounters();for(let t=0;t<o.length;t++)o[t]=0;if(r)oe.recordPatternInReverse(t,e.getStartEnd()[0],o);else{oe.recordPattern(t,e.getStartEnd()[1],o);for(let t=0,e=o.length-1;t<e;t++,e--){let n=o[t];o[t]=o[e],o[e]=n}}let i=17,a=ot.sum(new Int32Array(o))/i,s=(e.getStartEnd()[1]-e.getStartEnd()[0])/15;if(Math.abs(a-s)/s>.3)throw new T;let c=this.getOddCounts(),l=this.getEvenCounts(),d=this.getOddRoundingErrors(),u=this.getEvenRoundingErrors();for(let t=0;t<o.length;t++){let e=1*o[t]/a,n=e+.5;if(n<1){if(e<.3)throw new T;n=1}else if(n>8){if(e>8.7)throw new T;n=8}let r=t/2;1&t?(l[r]=n,u[r]=e-n):(c[r]=n,d[r]=e-n)}this.adjustOddEvenCounts(i);let h=4*e.getValue()+(n?0:2)+(r?0:1)-1,m=0,f=0;for(let t=c.length-1;t>=0;t--){if(oe.isNotA1left(e,n,r)){let e=oe.WEIGHTS[h][2*t];f+=c[t]*e}m+=c[t]}let p=0;for(let t=l.length-1;t>=0;t--)if(oe.isNotA1left(e,n,r)){let e=oe.WEIGHTS[h][2*t+1];p+=l[t]*e}let _=f+p;if(1&m||m>13||m<4)throw new T;let g=(13-m)/2,w=oe.SYMBOL_WIDEST[g],$=9-w,y=Mt.getRSSvalue(c,w,!0),b=Mt.getRSSvalue(l,$,!1),v=oe.EVEN_TOTAL_SUBSET[g],I=oe.GSUM[g];return new xt(y*v+b+I,_)}static isNotA1left(t,e,n){return!(0==t.getValue()&&e&&n)}adjustOddEvenCounts(t){let e=ot.sum(new Int32Array(this.getOddCounts())),n=ot.sum(new Int32Array(this.getEvenCounts())),r=!1,o=!1;e>13?o=!0:e<4&&(r=!0);let i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);let s=e+n-t,c=!(1&~e),l=!(1&n);if(1==s)if(c){if(l)throw new T;o=!0}else{if(!l)throw new T;a=!0}else if(-1==s)if(c){if(l)throw new T;r=!0}else{if(!l)throw new T;i=!0}else{if(0!=s)throw new T;if(c){if(!l)throw new T;e<n?(r=!0,a=!0):(o=!0,i=!0)}else if(l)throw new T}if(r){if(o)throw new T;oe.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&oe.decrement(this.getOddCounts(),this.getOddRoundingErrors()),i){if(a)throw new T;oe.increment(this.getEvenCounts(),this.getOddRoundingErrors())}a&&oe.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}oe.SYMBOL_WIDEST=[7,5,4,3,1],oe.EVEN_TOTAL_SUBSET=[4,20,52,104,204],oe.GSUM=[0,348,1388,2948,3988],oe.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],oe.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],oe.FINDER_PAT_A=0,oe.FINDER_PAT_B=1,oe.FINDER_PAT_C=2,oe.FINDER_PAT_D=3,oe.FINDER_PAT_E=4,oe.FINDER_PAT_F=5,oe.FINDER_PATTERN_SEQUENCES=[[oe.FINDER_PAT_A,oe.FINDER_PAT_A],[oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B],[oe.FINDER_PAT_A,oe.FINDER_PAT_C,oe.FINDER_PAT_B,oe.FINDER_PAT_D],[oe.FINDER_PAT_A,oe.FINDER_PAT_E,oe.FINDER_PAT_B,oe.FINDER_PAT_D,oe.FINDER_PAT_C],[oe.FINDER_PAT_A,oe.FINDER_PAT_E,oe.FINDER_PAT_B,oe.FINDER_PAT_D,oe.FINDER_PAT_D,oe.FINDER_PAT_F],[oe.FINDER_PAT_A,oe.FINDER_PAT_E,oe.FINDER_PAT_B,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_F,oe.FINDER_PAT_F],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_D],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_E],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_F,oe.FINDER_PAT_F],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_E,oe.FINDER_PAT_F,oe.FINDER_PAT_F]],oe.MAX_PAIRS=11;class ie extends xt{constructor(t,e,n){super(t,e),this.count=0,this.finderPattern=n}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class ae extends Dt{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(t,e,n){const r=this.decodePair(e,!1,t,n);ae.addOrTally(this.possibleLeftPairs,r),e.reverse();let o=this.decodePair(e,!0,t,n);ae.addOrTally(this.possibleRightPairs,o),e.reverse();for(let t of this.possibleLeftPairs)if(t.getCount()>1)for(let e of this.possibleRightPairs)if(e.getCount()>1&&ae.checkChecksum(t,e))return ae.constructResult(t,e);throw new T}static addOrTally(t,e){if(null==e)return;let n=!1;for(let r of t)if(r.getValue()===e.getValue()){r.incrementCount(),n=!0;break}n||t.push(e)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(t,e){let n=4537077*t.getValue()+e.getValue(),r=new String(n).toString(),o=new S;for(let t=13-r.length;t>0;t--)o.append("0");o.append(r);let i=0;for(let t=0;t<13;t++){let e=o.charAt(t).charCodeAt(0)-"0".charCodeAt(0);i+=1&t?e:3*e}i=10-i%10,10===i&&(i=0),o.append(i.toString());let a=t.getFinderPattern().getResultPoints(),s=e.getFinderPattern().getResultPoints();return new L(o.toString(),null,0,[a[0],a[1],s[0],s[1]],V.RSS_14,(new Date).getTime())}static checkChecksum(t,e){let n=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,r=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r}decodePair(t,e,n,r){try{let o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,n,e,o),a=null==r?null:r.get(b.NEED_RESULT_POINT_CALLBACK);if(null!=a){let r=(o[0]+o[1])/2;e&&(r=t.getSize()-1-r),a.foundPossibleResultPoint(new at(r,n))}let s=this.decodeDataCharacter(t,i,!0),c=this.decodeDataCharacter(t,i,!1);return new ie(1597*s.getValue()+c.getValue(),s.getChecksumPortion()+4*c.getChecksumPortion(),i)}catch(t){return null}}decodeDataCharacter(t,e,n){let r=this.getDataCharacterCounters();for(let t=0;t<r.length;t++)r[t]=0;if(n)wt.recordPatternInReverse(t,e.getStartEnd()[0],r);else{wt.recordPattern(t,e.getStartEnd()[1]+1,r);for(let t=0,e=r.length-1;t<e;t++,e--){let n=r[t];r[t]=r[e],r[e]=n}}let o=n?16:15,i=ot.sum(new Int32Array(r))/o,a=this.getOddCounts(),s=this.getEvenCounts(),c=this.getOddRoundingErrors(),l=this.getEvenRoundingErrors();for(let t=0;t<r.length;t++){let e=r[t]/i,n=Math.floor(e+.5);n<1?n=1:n>8&&(n=8);let o=Math.floor(t/2);1&t?(s[o]=n,l[o]=e-n):(a[o]=n,c[o]=e-n)}this.adjustOddEvenCounts(n,o);let d=0,u=0;for(let t=a.length-1;t>=0;t--)u*=9,u+=a[t],d+=a[t];let h=0,m=0;for(let t=s.length-1;t>=0;t--)h*=9,h+=s[t],m+=s[t];let f=u+3*h;if(n){if(1&d||d>12||d<4)throw new T;let t=(12-d)/2,e=ae.OUTSIDE_ODD_WIDEST[t],n=9-e,r=Mt.getRSSvalue(a,e,!1),o=Mt.getRSSvalue(s,n,!0),i=ae.OUTSIDE_EVEN_TOTAL_SUBSET[t],c=ae.OUTSIDE_GSUM[t];return new xt(r*i+o+c,f)}{if(1&m||m>10||m<4)throw new T;let t=(10-m)/2,e=ae.INSIDE_ODD_WIDEST[t],n=9-e,r=Mt.getRSSvalue(a,e,!0),o=Mt.getRSSvalue(s,n,!1),i=ae.INSIDE_ODD_TOTAL_SUBSET[t],c=ae.INSIDE_GSUM[t];return new xt(o*i+r+c,f)}}findFinderPattern(t,e){let n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;let r=t.getSize(),o=!1,i=0;for(;i<r&&(o=!t.get(i),e!==o);)i++;let a=0,s=i;for(let e=i;e<r;e++)if(t.get(e)!==o)n[a]++;else{if(3===a){if(Dt.isFinderPattern(n))return[s,e];s+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,a--}else a++;n[a]=1,o=!o}throw new T}parseFoundFinderPattern(t,e,n,r){let o=t.get(r[0]),i=r[0]-1;for(;i>=0&&o!==t.get(i);)i--;i++;const a=r[0]-i,s=this.getDecodeFinderCounters(),c=new Int32Array(s.length);f.arraycopy(s,0,c,1,s.length-1),c[0]=a;const l=this.parseFinderValue(c,ae.FINDER_PATTERNS);let d=i,u=r[1];return n&&(d=t.getSize()-1-d,u=t.getSize()-1-u),new Ot(l,[i,r[1]],d,u,e)}adjustOddEvenCounts(t,e){let n=ot.sum(new Int32Array(this.getOddCounts())),r=ot.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(n>12?i=!0:n<4&&(o=!0),r>12?s=!0:r<4&&(a=!0)):(n>11?i=!0:n<5&&(o=!0),r>10?s=!0:r<4&&(a=!0));let c=n+r-e,l=(1&n)==(t?1:0),d=!(1&~r);if(1===c)if(l){if(d)throw new T;i=!0}else{if(!d)throw new T;s=!0}else if(-1===c)if(l){if(d)throw new T;o=!0}else{if(!d)throw new T;a=!0}else{if(0!==c)throw new T;if(l){if(!d)throw new T;n<r?(o=!0,s=!0):(i=!0,a=!0)}else if(d)throw new T}if(o){if(i)throw new T;Dt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&Dt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new T;Dt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Dt.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}ae.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],ae.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],ae.OUTSIDE_GSUM=[0,161,961,2015,2715],ae.INSIDE_GSUM=[0,336,1036,1516],ae.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],ae.INSIDE_ODD_WIDEST=[2,4,6,8],ae.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class se extends wt{constructor(t,e){super(),this.readers=[],this.verbose=!0===e;const n=t?t.get(b.POSSIBLE_FORMATS):null,r=t&&void 0!==t.get(b.ASSUME_CODE_39_CHECK_DIGIT);n?((n.includes(V.EAN_13)||n.includes(V.UPC_A)||n.includes(V.EAN_8)||n.includes(V.UPC_E))&&this.readers.push(new Nt(t)),n.includes(V.CODE_39)&&this.readers.push(new yt(r)),n.includes(V.CODE_128)&&this.readers.push(new $t),n.includes(V.ITF)&&this.readers.push(new bt),n.includes(V.RSS_14)&&this.readers.push(new ae),n.includes(V.RSS_EXPANDED)&&this.readers.push(new oe(this.verbose))):(this.readers.push(new Nt(t)),this.readers.push(new yt),this.readers.push(new Nt(t)),this.readers.push(new $t),this.readers.push(new bt),this.readers.push(new ae),this.readers.push(new oe(this.verbose)))}decodeRow(t,e,n){for(let r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(t,e,n)}catch(t){}throw new T}reset(){this.readers.forEach(t=>t.reset())}}class ce extends F{constructor(t=500,e){super(new se(e),t,e)}}class le{constructor(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class de{constructor(t,e){this.count=t,this.dataCodewords=e}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class ue{constructor(t,e,n,r,o,i){this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=o,this.ecBlocks=i;let a=0;const s=i.getECCodewords(),c=i.getECBlocks();for(let t of c)a+=t.getCount()*(t.getDataCodewords()+s);this.totalCodewords=a}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(t,e){if(1&t||1&e)throw new v;for(let n of ue.VERSIONS)if(n.symbolSizeRows===t&&n.symbolSizeColumns===e)return n;throw new v}toString(){return""+this.versionNumber}static buildVersions(){return[new ue(1,10,10,8,8,new le(5,new de(1,3))),new ue(2,12,12,10,10,new le(7,new de(1,5))),new ue(3,14,14,12,12,new le(10,new de(1,8))),new ue(4,16,16,14,14,new le(12,new de(1,12))),new ue(5,18,18,16,16,new le(14,new de(1,18))),new ue(6,20,20,18,18,new le(18,new de(1,22))),new ue(7,22,22,20,20,new le(20,new de(1,30))),new ue(8,24,24,22,22,new le(24,new de(1,36))),new ue(9,26,26,24,24,new le(28,new de(1,44))),new ue(10,32,32,14,14,new le(36,new de(1,62))),new ue(11,36,36,16,16,new le(42,new de(1,86))),new ue(12,40,40,18,18,new le(48,new de(1,114))),new ue(13,44,44,20,20,new le(56,new de(1,144))),new ue(14,48,48,22,22,new le(68,new de(1,174))),new ue(15,52,52,24,24,new le(42,new de(2,102))),new ue(16,64,64,14,14,new le(56,new de(2,140))),new ue(17,72,72,16,16,new le(36,new de(4,92))),new ue(18,80,80,18,18,new le(48,new de(4,114))),new ue(19,88,88,20,20,new le(56,new de(4,144))),new ue(20,96,96,22,22,new le(68,new de(4,174))),new ue(21,104,104,24,24,new le(56,new de(6,136))),new ue(22,120,120,18,18,new le(68,new de(6,175))),new ue(23,132,132,20,20,new le(62,new de(8,163))),new ue(24,144,144,22,22,new le(62,new de(8,156),new de(2,155))),new ue(25,8,18,6,16,new le(7,new de(1,5))),new ue(26,8,32,6,14,new le(11,new de(1,10))),new ue(27,12,26,10,24,new le(14,new de(1,16))),new ue(28,12,36,10,16,new le(18,new de(1,22))),new ue(29,16,36,14,16,new le(24,new de(1,32))),new ue(30,16,48,14,22,new le(28,new de(1,49)))]}}ue.VERSIONS=ue.buildVersions();class he{constructor(t){const e=t.getHeight();if(e<8||e>144||1&e)throw new v;this.version=he.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new k(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(t){const e=t.getHeight(),n=t.getWidth();return ue.getVersionForDimensions(e,n)}readCodewords(){const t=new Int8Array(this.version.getTotalCodewords());let e=0,n=4,r=0;const o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth();let a=!1,s=!1,c=!1,l=!1;do{if(n!==o||0!==r||a)if(n===o-2&&0===r&&3&i&&!s)t[e++]=255&this.readCorner2(o,i),n-=2,r+=2,s=!0;else if(n!==o+4||2!==r||7&i||c)if(n!==o-2||0!==r||4!=(7&i)||l){do{n<o&&r>=0&&!this.readMappingMatrix.get(r,n)&&(t[e++]=255&this.readUtah(n,r,o,i)),n-=2,r+=2}while(n>=0&&r<i);n+=1,r+=3;do{n>=0&&r<i&&!this.readMappingMatrix.get(r,n)&&(t[e++]=255&this.readUtah(n,r,o,i)),n+=2,r-=2}while(n<o&&r>=0);n+=3,r+=1}else t[e++]=255&this.readCorner4(o,i),n-=2,r+=2,l=!0;else t[e++]=255&this.readCorner3(o,i),n-=2,r+=2,c=!0;else t[e++]=255&this.readCorner1(o,i),n-=2,r+=2,a=!0}while(n<o||r<i);if(e!==this.version.getTotalCodewords())throw new v;return t}readModule(t,e,n,r){return t<0&&(t+=n,e+=4-(n+4&7)),e<0&&(e+=r,t+=4-(r+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)}readUtah(t,e,n,r){let o=0;return this.readModule(t-2,e-2,n,r)&&(o|=1),o<<=1,this.readModule(t-2,e-1,n,r)&&(o|=1),o<<=1,this.readModule(t-1,e-2,n,r)&&(o|=1),o<<=1,this.readModule(t-1,e-1,n,r)&&(o|=1),o<<=1,this.readModule(t-1,e,n,r)&&(o|=1),o<<=1,this.readModule(t,e-2,n,r)&&(o|=1),o<<=1,this.readModule(t,e-1,n,r)&&(o|=1),o<<=1,this.readModule(t,e,n,r)&&(o|=1),o}readCorner1(t,e){let n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,1,t,e)&&(n|=1),n<<=1,this.readModule(t-1,2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n}readCorner2(t,e){let n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-4,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n}readCorner3(t,e){let n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-3,t,e)&&(n|=1),n<<=1,this.readModule(1,e-2,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n}readCorner4(t,e){let n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n}extractDataRegion(t){const e=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new d("Dimension of bitMatrix must match the version size");const r=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=e/r|0,a=n/o|0,s=new k(a*o,i*r);for(let e=0;e<i;++e){const n=e*r;for(let i=0;i<a;++i){const a=i*o;for(let c=0;c<r;++c){const l=e*(r+2)+1+c,d=n+c;for(let e=0;e<o;++e){const n=i*(o+2)+1+e;if(t.get(n,l)){const t=a+e;s.set(t,d)}}}}}return s}}class me{constructor(t,e){this.numDataCodewords=t,this.codewords=e}static getDataBlocks(t,e){const n=e.getECBlocks();let r=0;const o=n.getECBlocks();for(let t of o)r+=t.getCount();const i=new Array(r);let a=0;for(let t of o)for(let e=0;e<t.getCount();e++){const e=t.getDataCodewords(),r=n.getECCodewords()+e;i[a++]=new me(e,new Uint8Array(r))}const s=i[0].codewords.length-n.getECCodewords(),c=s-1;let l=0;for(let e=0;e<c;e++)for(let n=0;n<a;n++)i[n].codewords[e]=t[l++];const u=24===e.getVersionNumber(),h=u?8:a;for(let e=0;e<h;e++)i[e].codewords[s-1]=t[l++];const m=i[0].codewords.length;for(let e=s;e<m;e++)for(let n=0;n<a;n++){const r=u?(n+8)%a:n,o=u&&r>7?e-1:e;i[r].codewords[o]=t[l++]}if(l!==t.length)throw new d;return i}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class fe{constructor(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(t){if(t<1||t>32||t>this.available())throw new d(""+t);let e=0,n=this.bitOffset,r=this.byteOffset;const o=this.bytes;if(n>0){const i=8-n,a=t<i?t:i,s=i-a,c=255>>8-a<<s;e=(o[r]&c)>>s,t-=a,n+=a,8===n&&(n=0,r++)}if(t>0){for(;t>=8;)e=e<<8|255&o[r],r++,t-=8;if(t>0){const i=8-t,a=255>>i<<i;e=e<<t|(o[r]&a)>>i,n+=t}}return this.bitOffset=n,this.byteOffset=r,e}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(U||(U={}));class pe{static decode(t){const e=new fe(t),n=new S,r=new S,o=new Array;let i=U.ASCII_ENCODE;do{if(i===U.ASCII_ENCODE)i=this.decodeAsciiSegment(e,n,r);else{switch(i){case U.C40_ENCODE:this.decodeC40Segment(e,n);break;case U.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case U.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case U.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case U.BASE256_ENCODE:this.decodeBase256Segment(e,n,o);break;default:throw new v}i=U.ASCII_ENCODE}}while(i!==U.PAD_ENCODE&&e.available()>0);return r.length()>0&&n.append(r.toString()),new Q(t,n.toString(),0===o.length?null:o,null)}static decodeAsciiSegment(t,e,n){let r=!1;do{let o=t.readBits(8);if(0===o)throw new v;if(o<=128)return r&&(o+=128),e.append(String.fromCharCode(o-1)),U.ASCII_ENCODE;if(129===o)return U.PAD_ENCODE;if(o<=229){const t=o-130;t<10&&e.append("0"),e.append(""+t)}else switch(o){case 230:return U.C40_ENCODE;case 231:return U.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:r=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return U.ANSIX12_ENCODE;case 239:return U.TEXT_ENCODE;case 240:return U.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new v}}while(t.available()>0);return U.ASCII_ENCODE}static decodeC40Segment(t,e){let n=!1;const r=[];let o=0;do{if(8===t.available())return;const i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),r);for(let t=0;t<3;t++){const i=r[t];switch(o){case 0:if(i<3)o=i+1;else{if(!(i<this.C40_BASIC_SET_CHARS.length))throw new v;{const t=this.C40_BASIC_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}}break;case 1:n?(e.append(String.fromCharCode(i+128)),n=!1):e.append(String.fromCharCode(i)),o=0;break;case 2:if(i<this.C40_SHIFT2_SET_CHARS.length){const t=this.C40_SHIFT2_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}else switch(i){case 27:e.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new v}o=0;break;case 3:n?(e.append(String.fromCharCode(i+224)),n=!1):e.append(String.fromCharCode(i+96)),o=0;break;default:throw new v}}}while(t.available()>0)}static decodeTextSegment(t,e){let n=!1,r=[],o=0;do{if(8===t.available())return;const i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),r);for(let t=0;t<3;t++){const i=r[t];switch(o){case 0:if(i<3)o=i+1;else{if(!(i<this.TEXT_BASIC_SET_CHARS.length))throw new v;{const t=this.TEXT_BASIC_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}}break;case 1:n?(e.append(String.fromCharCode(i+128)),n=!1):e.append(String.fromCharCode(i)),o=0;break;case 2:if(i<this.TEXT_SHIFT2_SET_CHARS.length){const t=this.TEXT_SHIFT2_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}else switch(i){case 27:e.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new v}o=0;break;case 3:if(!(i<this.TEXT_SHIFT3_SET_CHARS.length))throw new v;{const t=this.TEXT_SHIFT3_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t),o=0}break;default:throw new v}}}while(t.available()>0)}static decodeAnsiX12Segment(t,e){const n=[];do{if(8===t.available())return;const r=t.readBits(8);if(254===r)return;this.parseTwoBytes(r,t.readBits(8),n);for(let t=0;t<3;t++){const r=n[t];switch(r){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(r<14)e.append(String.fromCharCode(r+44));else{if(!(r<40))throw new v;e.append(String.fromCharCode(r+51))}}}}while(t.available()>0)}static parseTwoBytes(t,e,n){let r=(t<<8)+e-1,o=Math.floor(r/1600);n[0]=o,r-=1600*o,o=Math.floor(r/40),n[1]=o,n[2]=r-40*o}static decodeEdifactSegment(t,e){do{if(t.available()<=16)return;for(let n=0;n<4;n++){let n=t.readBits(6);if(31===n){const e=8-t.getBitOffset();return void(8!==e&&t.readBits(e))}32&n||(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)}static decodeBase256Segment(t,e,n){let r=1+t.getByteOffset();const o=this.unrandomize255State(t.readBits(8),r++);let i;if(i=0===o?t.available()/8|0:o<250?o:250*(o-249)+this.unrandomize255State(t.readBits(8),r++),i<0)throw new v;const a=new Uint8Array(i);for(let e=0;e<i;e++){if(t.available()<8)throw new v;a[e]=this.unrandomize255State(t.readBits(8),r++)}n.push(a);try{e.append(E.decode(a,A.ISO88591))}catch(t){throw new et("Platform does not support required encoding: "+t.message)}}static unrandomize255State(t,e){const n=t-(149*e%255+1);return n>=0?n:n+256}}pe.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pe.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],pe.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],pe.TEXT_SHIFT2_SET_CHARS=pe.C40_SHIFT2_SET_CHARS,pe.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)];class _e{constructor(){this.rsDecoder=new nt(J.DATA_MATRIX_FIELD_256)}decode(t){const e=new he(t),n=e.getVersion(),r=e.readCodewords(),o=me.getDataBlocks(r,n);let i=0;for(let t of o)i+=t.getNumDataCodewords();const a=new Uint8Array(i),s=o.length;for(let t=0;t<s;t++){const e=o[t],n=e.getCodewords(),r=e.getNumDataCodewords();this.correctErrors(n,r);for(let e=0;e<r;e++)a[e*s+t]=n[e]}return pe.decode(a)}correctErrors(t,e){const n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch(t){throw new h}for(let r=0;r<e;r++)t[r]=n[r]}}class ge{constructor(t){this.image=t,this.rectangleDetector=new lt(this.image)}detect(){const t=this.rectangleDetector.detect();let e=this.detectSolid1(t);if(e=this.detectSolid2(e),e[3]=this.correctTopRight(e),!e[3])throw new T;e=this.shiftToModuleCenter(e);const n=e[0],r=e[1],o=e[2],i=e[3];let a=this.transitionsBetween(n,i)+1,s=this.transitionsBetween(o,i)+1;1&~a||(a+=1),1&~s||(s+=1),4*a<7*s&&4*s<7*a&&(a=s=Math.max(a,s));let c=ge.sampleGrid(this.image,n,r,o,i,a,s);return new st(c,[n,r,o,i])}static shiftPoint(t,e,n){let r=(e.getX()-t.getX())/(n+1),o=(e.getY()-t.getY())/(n+1);return new at(t.getX()+r,t.getY()+o)}static moveAway(t,e,n){let r=t.getX(),o=t.getY();return r<e?r-=1:r+=1,o<n?o-=1:o+=1,new at(r,o)}detectSolid1(t){let e=t[0],n=t[1],r=t[3],o=t[2],i=this.transitionsBetween(e,n),a=this.transitionsBetween(n,r),s=this.transitionsBetween(r,o),c=this.transitionsBetween(o,e),l=i,d=[o,e,n,r];return l>a&&(l=a,d[0]=e,d[1]=n,d[2]=r,d[3]=o),l>s&&(l=s,d[0]=n,d[1]=r,d[2]=o,d[3]=e),l>c&&(d[0]=r,d[1]=o,d[2]=e,d[3]=n),d}detectSolid2(t){let e=t[0],n=t[1],r=t[2],o=t[3],i=this.transitionsBetween(e,o),a=ge.shiftPoint(n,r,4*(i+1)),s=ge.shiftPoint(r,n,4*(i+1));return this.transitionsBetween(a,e)<this.transitionsBetween(s,o)?(t[0]=e,t[1]=n,t[2]=r,t[3]=o):(t[0]=n,t[1]=r,t[2]=o,t[3]=e),t}correctTopRight(t){let e=t[0],n=t[1],r=t[2],o=t[3],i=this.transitionsBetween(e,o),a=this.transitionsBetween(n,o),s=ge.shiftPoint(e,n,4*(a+1)),c=ge.shiftPoint(r,n,4*(i+1));i=this.transitionsBetween(s,o),a=this.transitionsBetween(c,o);let l=new at(o.getX()+(r.getX()-n.getX())/(i+1),o.getY()+(r.getY()-n.getY())/(i+1)),d=new at(o.getX()+(e.getX()-n.getX())/(a+1),o.getY()+(e.getY()-n.getY())/(a+1));return this.isValid(l)?this.isValid(d)?this.transitionsBetween(s,l)+this.transitionsBetween(c,l)>this.transitionsBetween(s,d)+this.transitionsBetween(c,d)?l:d:l:this.isValid(d)?d:null}shiftToModuleCenter(t){let e=t[0],n=t[1],r=t[2],o=t[3],i=this.transitionsBetween(e,o)+1,a=this.transitionsBetween(r,o)+1,s=ge.shiftPoint(e,n,4*a),c=ge.shiftPoint(r,n,4*i);i=this.transitionsBetween(s,o)+1,a=this.transitionsBetween(c,o)+1,1&~i||(i+=1),1&~a||(a+=1);let l,d,u=(e.getX()+n.getX()+r.getX()+o.getX())/4,h=(e.getY()+n.getY()+r.getY()+o.getY())/4;return e=ge.moveAway(e,u,h),n=ge.moveAway(n,u,h),r=ge.moveAway(r,u,h),o=ge.moveAway(o,u,h),s=ge.shiftPoint(e,n,4*a),s=ge.shiftPoint(s,o,4*i),l=ge.shiftPoint(n,e,4*a),l=ge.shiftPoint(l,r,4*i),c=ge.shiftPoint(r,o,4*a),c=ge.shiftPoint(c,n,4*i),d=ge.shiftPoint(o,r,4*a),d=ge.shiftPoint(d,e,4*i),[s,l,c,d]}isValid(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()}static sampleGrid(t,e,n,r,o,i,a){return mt.getInstance().sampleGrid(t,i,a,.5,.5,i-.5,.5,i-.5,a-.5,.5,a-.5,e.getX(),e.getY(),o.getX(),o.getY(),r.getX(),r.getY(),n.getX(),n.getY())}transitionsBetween(t,e){let n=Math.trunc(t.getX()),r=Math.trunc(t.getY()),o=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.abs(i-r)>Math.abs(o-n);if(a){let t=n;n=r,r=t,t=o,o=i,i=t}let s=Math.abs(o-n),c=Math.abs(i-r),l=-s/2,d=r<i?1:-1,u=n<o?1:-1,h=0,m=this.image.get(a?r:n,a?n:r);for(let t=n,e=r;t!==o;t+=u){let n=this.image.get(a?e:t,a?t:e);if(n!==m&&(h++,m=n),l+=c,l>0){if(e===i)break;e+=d,l-=s}}return h}}class we{constructor(){this.decoder=new _e}decode(t,e=null){let n,r;if(null!=e&&e.has(b.PURE_BARCODE)){const e=we.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(e),r=we.NO_POINTS}else{const e=new ge(t.getBlackMatrix()).detect();n=this.decoder.decode(e.getBits()),r=e.getPoints()}const o=n.getRawBytes(),i=new L(n.getText(),o,8*o.length,r,V.DATA_MATRIX,f.currentTimeMillis()),a=n.getByteSegments();null!=a&&i.putMetadata(X.BYTE_SEGMENTS,a);const s=n.getECLevel();return null!=s&&i.putMetadata(X.ERROR_CORRECTION_LEVEL,s),i}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(null==e||null==n)throw new T;const r=this.moduleSize(e,t);let o=e[1];const i=n[1];let a=e[0];const s=(n[0]-a+1)/r,c=(i-o+1)/r;if(s<=0||c<=0)throw new T;const l=r/2;o+=l,a+=l;const d=new k(s,c);for(let e=0;e<c;e++){const n=o+e*r;for(let o=0;o<s;o++)t.get(a+o*r,n)&&d.set(o,e)}return d}static moduleSize(t,e){const n=e.getWidth();let r=t[0];const o=t[1];for(;r<n&&e.get(r,o);)r++;if(r===n)throw new T;const i=r-t[0];if(0===i)throw new T;return i}}we.NO_POINTS=[];class $e extends F{constructor(t=500){super(new we,t)}}!function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(z||(z={}));class ye{constructor(t,e,n){this.value=t,this.stringValue=e,this.bits=n,ye.FOR_BITS.set(n,this),ye.FOR_VALUE.set(t,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(t){switch(t){case"L":return ye.L;case"M":return ye.M;case"Q":return ye.Q;case"H":return ye.H;default:throw new l(t+"not available")}}toString(){return this.stringValue}equals(t){if(!(t instanceof ye))return!1;const e=t;return this.value===e.value}static forBits(t){if(t<0||t>=ye.FOR_BITS.size)throw new d;return ye.FOR_BITS.get(t)}}ye.FOR_BITS=new Map,ye.FOR_VALUE=new Map,ye.L=new ye(z.L,"L",1),ye.M=new ye(z.M,"M",0),ye.Q=new ye(z.Q,"Q",3),ye.H=new ye(z.H,"H",2);class be{constructor(t){this.errorCorrectionLevel=ye.forBits(t>>3&3),this.dataMask=7&t}static numBitsDiffering(t,e){return w.bitCount(t^e)}static decodeFormatInformation(t,e){const n=be.doDecodeFormatInformation(t,e);return null!==n?n:be.doDecodeFormatInformation(t^be.FORMAT_INFO_MASK_QR,e^be.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(t,e){let n=Number.MAX_SAFE_INTEGER,r=0;for(const o of be.FORMAT_INFO_DECODE_LOOKUP){const i=o[0];if(i===t||i===e)return new be(o[1]);let a=be.numBitsDiffering(t,i);a<n&&(r=o[1],n=a),t!==e&&(a=be.numBitsDiffering(e,i),a<n&&(r=o[1],n=a))}return n<=3?new be(r):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(t){if(!(t instanceof be))return!1;const e=t;return this.errorCorrectionLevel===e.errorCorrectionLevel&&this.dataMask===e.dataMask}}be.FORMAT_INFO_MASK_QR=21522,be.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class ve{constructor(t,...e){this.ecCodewordsPerBlock=t,this.ecBlocks=e}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let t=0;const e=this.ecBlocks;for(const n of e)t+=n.getCount();return t}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class Ie{constructor(t,e){this.count=t,this.dataCodewords=e}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class Ce{constructor(t,e,...n){this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=n;let r=0;const o=n[0].getECCodewordsPerBlock(),i=n[0].getECBlocks();for(const t of i)r+=t.getCount()*(t.getDataCodewords()+o);this.totalCodewords=r}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(t){return this.ecBlocks[t.getValue()]}static getProvisionalVersionForDimension(t){if(t%4!=1)throw new v;try{return this.getVersionForNumber((t-17)/4)}catch(t){throw new v}}static getVersionForNumber(t){if(t<1||t>40)throw new d;return Ce.VERSIONS[t-1]}static decodeVersionInformation(t){let e=Number.MAX_SAFE_INTEGER,n=0;for(let r=0;r<Ce.VERSION_DECODE_INFO.length;r++){const o=Ce.VERSION_DECODE_INFO[r];if(o===t)return Ce.getVersionForNumber(r+7);const i=be.numBitsDiffering(t,o);i<e&&(n=r+7,e=i)}return e<=3?Ce.getVersionForNumber(n):null}buildFunctionPattern(){const t=this.getDimensionForVersion(),e=new k(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);const n=this.alignmentPatternCenters.length;for(let t=0;t<n;t++){const r=this.alignmentPatternCenters[t]-2;for(let o=0;o<n;o++)0===t&&(0===o||o===n-1)||t===n-1&&0===o||e.setRegion(this.alignmentPatternCenters[o]-2,r,5,5)}return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e}toString(){return""+this.versionNumber}}Ce.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),Ce.VERSIONS=[new Ce(1,new Int32Array(0),new ve(7,new Ie(1,19)),new ve(10,new Ie(1,16)),new ve(13,new Ie(1,13)),new ve(17,new Ie(1,9))),new Ce(2,Int32Array.from([6,18]),new ve(10,new Ie(1,34)),new ve(16,new Ie(1,28)),new ve(22,new Ie(1,22)),new ve(28,new Ie(1,16))),new Ce(3,Int32Array.from([6,22]),new ve(15,new Ie(1,55)),new ve(26,new Ie(1,44)),new ve(18,new Ie(2,17)),new ve(22,new Ie(2,13))),new Ce(4,Int32Array.from([6,26]),new ve(20,new Ie(1,80)),new ve(18,new Ie(2,32)),new ve(26,new Ie(2,24)),new ve(16,new Ie(4,9))),new Ce(5,Int32Array.from([6,30]),new ve(26,new Ie(1,108)),new ve(24,new Ie(2,43)),new ve(18,new Ie(2,15),new Ie(2,16)),new ve(22,new Ie(2,11),new Ie(2,12))),new Ce(6,Int32Array.from([6,34]),new ve(18,new Ie(2,68)),new ve(16,new Ie(4,27)),new ve(24,new Ie(4,19)),new ve(28,new Ie(4,15))),new Ce(7,Int32Array.from([6,22,38]),new ve(20,new Ie(2,78)),new ve(18,new Ie(4,31)),new ve(18,new Ie(2,14),new Ie(4,15)),new ve(26,new Ie(4,13),new Ie(1,14))),new Ce(8,Int32Array.from([6,24,42]),new ve(24,new Ie(2,97)),new ve(22,new Ie(2,38),new Ie(2,39)),new ve(22,new Ie(4,18),new Ie(2,19)),new ve(26,new Ie(4,14),new Ie(2,15))),new Ce(9,Int32Array.from([6,26,46]),new ve(30,new Ie(2,116)),new ve(22,new Ie(3,36),new Ie(2,37)),new ve(20,new Ie(4,16),new Ie(4,17)),new ve(24,new Ie(4,12),new Ie(4,13))),new Ce(10,Int32Array.from([6,28,50]),new ve(18,new Ie(2,68),new Ie(2,69)),new ve(26,new Ie(4,43),new Ie(1,44)),new ve(24,new Ie(6,19),new Ie(2,20)),new ve(28,new Ie(6,15),new Ie(2,16))),new Ce(11,Int32Array.from([6,30,54]),new ve(20,new Ie(4,81)),new ve(30,new Ie(1,50),new Ie(4,51)),new ve(28,new Ie(4,22),new Ie(4,23)),new ve(24,new Ie(3,12),new Ie(8,13))),new Ce(12,Int32Array.from([6,32,58]),new ve(24,new Ie(2,92),new Ie(2,93)),new ve(22,new Ie(6,36),new Ie(2,37)),new ve(26,new Ie(4,20),new Ie(6,21)),new ve(28,new Ie(7,14),new Ie(4,15))),new Ce(13,Int32Array.from([6,34,62]),new ve(26,new Ie(4,107)),new ve(22,new Ie(8,37),new Ie(1,38)),new ve(24,new Ie(8,20),new Ie(4,21)),new ve(22,new Ie(12,11),new Ie(4,12))),new Ce(14,Int32Array.from([6,26,46,66]),new ve(30,new Ie(3,115),new Ie(1,116)),new ve(24,new Ie(4,40),new Ie(5,41)),new ve(20,new Ie(11,16),new Ie(5,17)),new ve(24,new Ie(11,12),new Ie(5,13))),new Ce(15,Int32Array.from([6,26,48,70]),new ve(22,new Ie(5,87),new Ie(1,88)),new ve(24,new Ie(5,41),new Ie(5,42)),new ve(30,new Ie(5,24),new Ie(7,25)),new ve(24,new Ie(11,12),new Ie(7,13))),new Ce(16,Int32Array.from([6,26,50,74]),new ve(24,new Ie(5,98),new Ie(1,99)),new ve(28,new Ie(7,45),new Ie(3,46)),new ve(24,new Ie(15,19),new Ie(2,20)),new ve(30,new Ie(3,15),new Ie(13,16))),new Ce(17,Int32Array.from([6,30,54,78]),new ve(28,new Ie(1,107),new Ie(5,108)),new ve(28,new Ie(10,46),new Ie(1,47)),new ve(28,new Ie(1,22),new Ie(15,23)),new ve(28,new Ie(2,14),new Ie(17,15))),new Ce(18,Int32Array.from([6,30,56,82]),new ve(30,new Ie(5,120),new Ie(1,121)),new ve(26,new Ie(9,43),new Ie(4,44)),new ve(28,new Ie(17,22),new Ie(1,23)),new ve(28,new Ie(2,14),new Ie(19,15))),new Ce(19,Int32Array.from([6,30,58,86]),new ve(28,new Ie(3,113),new Ie(4,114)),new ve(26,new Ie(3,44),new Ie(11,45)),new ve(26,new Ie(17,21),new Ie(4,22)),new ve(26,new Ie(9,13),new Ie(16,14))),new Ce(20,Int32Array.from([6,34,62,90]),new ve(28,new Ie(3,107),new Ie(5,108)),new ve(26,new Ie(3,41),new Ie(13,42)),new ve(30,new Ie(15,24),new Ie(5,25)),new ve(28,new Ie(15,15),new Ie(10,16))),new Ce(21,Int32Array.from([6,28,50,72,94]),new ve(28,new Ie(4,116),new Ie(4,117)),new ve(26,new Ie(17,42)),new ve(28,new Ie(17,22),new Ie(6,23)),new ve(30,new Ie(19,16),new Ie(6,17))),new Ce(22,Int32Array.from([6,26,50,74,98]),new ve(28,new Ie(2,111),new Ie(7,112)),new ve(28,new Ie(17,46)),new ve(30,new Ie(7,24),new Ie(16,25)),new ve(24,new Ie(34,13))),new Ce(23,Int32Array.from([6,30,54,78,102]),new ve(30,new Ie(4,121),new Ie(5,122)),new ve(28,new Ie(4,47),new Ie(14,48)),new ve(30,new Ie(11,24),new Ie(14,25)),new ve(30,new Ie(16,15),new Ie(14,16))),new Ce(24,Int32Array.from([6,28,54,80,106]),new ve(30,new Ie(6,117),new Ie(4,118)),new ve(28,new Ie(6,45),new Ie(14,46)),new ve(30,new Ie(11,24),new Ie(16,25)),new ve(30,new Ie(30,16),new Ie(2,17))),new Ce(25,Int32Array.from([6,32,58,84,110]),new ve(26,new Ie(8,106),new Ie(4,107)),new ve(28,new Ie(8,47),new Ie(13,48)),new ve(30,new Ie(7,24),new Ie(22,25)),new ve(30,new Ie(22,15),new Ie(13,16))),new Ce(26,Int32Array.from([6,30,58,86,114]),new ve(28,new Ie(10,114),new Ie(2,115)),new ve(28,new Ie(19,46),new Ie(4,47)),new ve(28,new Ie(28,22),new Ie(6,23)),new ve(30,new Ie(33,16),new Ie(4,17))),new Ce(27,Int32Array.from([6,34,62,90,118]),new ve(30,new Ie(8,122),new Ie(4,123)),new ve(28,new Ie(22,45),new Ie(3,46)),new ve(30,new Ie(8,23),new Ie(26,24)),new ve(30,new Ie(12,15),new Ie(28,16))),new Ce(28,Int32Array.from([6,26,50,74,98,122]),new ve(30,new Ie(3,117),new Ie(10,118)),new ve(28,new Ie(3,45),new Ie(23,46)),new ve(30,new Ie(4,24),new Ie(31,25)),new ve(30,new Ie(11,15),new Ie(31,16))),new Ce(29,Int32Array.from([6,30,54,78,102,126]),new ve(30,new Ie(7,116),new Ie(7,117)),new ve(28,new Ie(21,45),new Ie(7,46)),new ve(30,new Ie(1,23),new Ie(37,24)),new ve(30,new Ie(19,15),new Ie(26,16))),new Ce(30,Int32Array.from([6,26,52,78,104,130]),new ve(30,new Ie(5,115),new Ie(10,116)),new ve(28,new Ie(19,47),new Ie(10,48)),new ve(30,new Ie(15,24),new Ie(25,25)),new ve(30,new Ie(23,15),new Ie(25,16))),new Ce(31,Int32Array.from([6,30,56,82,108,134]),new ve(30,new Ie(13,115),new Ie(3,116)),new ve(28,new Ie(2,46),new Ie(29,47)),new ve(30,new Ie(42,24),new Ie(1,25)),new ve(30,new Ie(23,15),new Ie(28,16))),new Ce(32,Int32Array.from([6,34,60,86,112,138]),new ve(30,new Ie(17,115)),new ve(28,new Ie(10,46),new Ie(23,47)),new ve(30,new Ie(10,24),new Ie(35,25)),new ve(30,new Ie(19,15),new Ie(35,16))),new Ce(33,Int32Array.from([6,30,58,86,114,142]),new ve(30,new Ie(17,115),new Ie(1,116)),new ve(28,new Ie(14,46),new Ie(21,47)),new ve(30,new Ie(29,24),new Ie(19,25)),new ve(30,new Ie(11,15),new Ie(46,16))),new Ce(34,Int32Array.from([6,34,62,90,118,146]),new ve(30,new Ie(13,115),new Ie(6,116)),new ve(28,new Ie(14,46),new Ie(23,47)),new ve(30,new Ie(44,24),new Ie(7,25)),new ve(30,new Ie(59,16),new Ie(1,17))),new Ce(35,Int32Array.from([6,30,54,78,102,126,150]),new ve(30,new Ie(12,121),new Ie(7,122)),new ve(28,new Ie(12,47),new Ie(26,48)),new ve(30,new Ie(39,24),new Ie(14,25)),new ve(30,new Ie(22,15),new Ie(41,16))),new Ce(36,Int32Array.from([6,24,50,76,102,128,154]),new ve(30,new Ie(6,121),new Ie(14,122)),new ve(28,new Ie(6,47),new Ie(34,48)),new ve(30,new Ie(46,24),new Ie(10,25)),new ve(30,new Ie(2,15),new Ie(64,16))),new Ce(37,Int32Array.from([6,28,54,80,106,132,158]),new ve(30,new Ie(17,122),new Ie(4,123)),new ve(28,new Ie(29,46),new Ie(14,47)),new ve(30,new Ie(49,24),new Ie(10,25)),new ve(30,new Ie(24,15),new Ie(46,16))),new Ce(38,Int32Array.from([6,32,58,84,110,136,162]),new ve(30,new Ie(4,122),new Ie(18,123)),new ve(28,new Ie(13,46),new Ie(32,47)),new ve(30,new Ie(48,24),new Ie(14,25)),new ve(30,new Ie(42,15),new Ie(32,16))),new Ce(39,Int32Array.from([6,26,54,82,110,138,166]),new ve(30,new Ie(20,117),new Ie(4,118)),new ve(28,new Ie(40,47),new Ie(7,48)),new ve(30,new Ie(43,24),new Ie(22,25)),new ve(30,new Ie(10,15),new Ie(67,16))),new Ce(40,Int32Array.from([6,30,58,86,114,142,170]),new ve(30,new Ie(19,118),new Ie(6,119)),new ve(28,new Ie(18,47),new Ie(31,48)),new ve(30,new Ie(34,24),new Ie(34,25)),new ve(30,new Ie(20,15),new Ie(61,16)))],function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(W||(W={}));class Ee{constructor(t,e){this.value=t,this.isMasked=e}unmaskBitMatrix(t,e){for(let n=0;n<e;n++)for(let r=0;r<e;r++)this.isMasked(n,r)&&t.flip(r,n)}}Ee.values=new Map([[W.DATA_MASK_000,new Ee(W.DATA_MASK_000,(t,e)=>!(t+e&1))],[W.DATA_MASK_001,new Ee(W.DATA_MASK_001,(t,e)=>!(1&t))],[W.DATA_MASK_010,new Ee(W.DATA_MASK_010,(t,e)=>e%3==0)],[W.DATA_MASK_011,new Ee(W.DATA_MASK_011,(t,e)=>(t+e)%3==0)],[W.DATA_MASK_100,new Ee(W.DATA_MASK_100,(t,e)=>!(Math.floor(t/2)+Math.floor(e/3)&1))],[W.DATA_MASK_101,new Ee(W.DATA_MASK_101,(t,e)=>t*e%6==0)],[W.DATA_MASK_110,new Ee(W.DATA_MASK_110,(t,e)=>t*e%6<3)],[W.DATA_MASK_111,new Ee(W.DATA_MASK_111,(t,e)=>!(t+e+t*e%3&1))]]);class Ae{constructor(t){const e=t.getHeight();if(e<21||1!=(3&e))throw new v;this.bitMatrix=t}readFormatInformation(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;let t=0;for(let e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(let e=5;e>=0;e--)t=this.copyBit(8,e,t);const e=this.bitMatrix.getHeight();let n=0;const r=e-7;for(let t=e-1;t>=r;t--)n=this.copyBit(8,t,n);for(let t=e-8;t<e;t++)n=this.copyBit(t,8,n);if(this.parsedFormatInfo=be.decodeFormatInformation(t,n),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new v}readVersion(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;const t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Ce.getVersionForNumber(e);let n=0;const r=t-11;for(let e=5;e>=0;e--)for(let o=t-9;o>=r;o--)n=this.copyBit(o,e,n);let o=Ce.decodeVersionInformation(n);if(null!==o&&o.getDimensionForVersion()===t)return this.parsedVersion=o,o;n=0;for(let e=5;e>=0;e--)for(let o=t-9;o>=r;o--)n=this.copyBit(e,o,n);if(o=Ce.decodeVersionInformation(n),null!==o&&o.getDimensionForVersion()===t)return this.parsedVersion=o,o;throw new v}copyBit(t,e,n){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?n<<1|1:n<<1}readCodewords(){const t=this.readFormatInformation(),e=this.readVersion(),n=Ee.values.get(t.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);const o=e.buildFunctionPattern();let i=!0;const a=new Uint8Array(e.getTotalCodewords());let s=0,c=0,l=0;for(let t=r-1;t>0;t-=2){6===t&&t--;for(let e=0;e<r;e++){const n=i?r-1-e:e;for(let e=0;e<2;e++)o.get(t-e,n)||(l++,c<<=1,this.bitMatrix.get(t-e,n)&&(c|=1),8===l&&(a[s++]=c,l=0,c=0))}i=!i}if(s!==e.getTotalCodewords())throw new v;return a}remask(){if(null===this.parsedFormatInfo)return;const t=Ee.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}setMirror(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t}mirror(){const t=this.bitMatrix;for(let e=0,n=t.getWidth();e<n;e++)for(let n=e+1,r=t.getHeight();n<r;n++)t.get(e,n)!==t.get(n,e)&&(t.flip(n,e),t.flip(e,n))}}class Se{constructor(t,e){this.numDataCodewords=t,this.codewords=e}static getDataBlocks(t,e,n){if(t.length!==e.getTotalCodewords())throw new d;const r=e.getECBlocksForLevel(n);let o=0;const i=r.getECBlocks();for(const t of i)o+=t.getCount();const a=new Array(o);let s=0;for(const t of i)for(let e=0;e<t.getCount();e++){const e=t.getDataCodewords(),n=r.getECCodewordsPerBlock()+e;a[s++]=new Se(e,new Uint8Array(n))}const c=a[0].codewords.length;let l=a.length-1;for(;l>=0&&a[l].codewords.length!==c;)l--;l++;const u=c-r.getECCodewordsPerBlock();let h=0;for(let e=0;e<u;e++)for(let n=0;n<s;n++)a[n].codewords[e]=t[h++];for(let e=l;e<s;e++)a[e].codewords[u]=t[h++];const m=a[0].codewords.length;for(let e=u;e<m;e++)for(let n=0;n<s;n++){const r=n<l?e:e+1;a[n].codewords[r]=t[h++]}return a}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}!function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"}(j||(j={}));class ke{constructor(t,e,n,r){this.value=t,this.stringValue=e,this.characterCountBitsForVersions=n,this.bits=r,ke.FOR_BITS.set(r,this),ke.FOR_VALUE.set(t,this)}static forBits(t){const e=ke.FOR_BITS.get(t);if(void 0===e)throw new d;return e}getCharacterCountBits(t){const e=t.getVersionNumber();let n;return n=e<=9?0:e<=26?1:2,this.characterCountBitsForVersions[n]}getValue(){return this.value}getBits(){return this.bits}equals(t){if(!(t instanceof ke))return!1;const e=t;return this.value===e.value}toString(){return this.stringValue}}ke.FOR_BITS=new Map,ke.FOR_VALUE=new Map,ke.TERMINATOR=new ke(j.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),ke.NUMERIC=new ke(j.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),ke.ALPHANUMERIC=new ke(j.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),ke.STRUCTURED_APPEND=new ke(j.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),ke.BYTE=new ke(j.BYTE,"BYTE",Int32Array.from([8,16,16]),4),ke.ECI=new ke(j.ECI,"ECI",Int32Array.from([0,0,0]),7),ke.KANJI=new ke(j.KANJI,"KANJI",Int32Array.from([8,10,12]),8),ke.FNC1_FIRST_POSITION=new ke(j.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),ke.FNC1_SECOND_POSITION=new ke(j.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),ke.HANZI=new ke(j.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class Te{static decode(t,e,n,r){const o=new fe(t);let i=new S;const a=new Array;let s=-1,c=-1;try{let t,n=null,l=!1;do{if(o.available()<4)t=ke.TERMINATOR;else{const e=o.readBits(4);t=ke.forBits(e)}switch(t){case ke.TERMINATOR:break;case ke.FNC1_FIRST_POSITION:case ke.FNC1_SECOND_POSITION:l=!0;break;case ke.STRUCTURED_APPEND:if(o.available()<16)throw new v;s=o.readBits(8),c=o.readBits(8);break;case ke.ECI:const d=Te.parseECIValue(o);if(n=I.getCharacterSetECIByValue(d),null===n)throw new v;break;case ke.HANZI:const u=o.readBits(4),h=o.readBits(t.getCharacterCountBits(e));u===Te.GB2312_SUBSET&&Te.decodeHanziSegment(o,i,h);break;default:const m=o.readBits(t.getCharacterCountBits(e));switch(t){case ke.NUMERIC:Te.decodeNumericSegment(o,i,m);break;case ke.ALPHANUMERIC:Te.decodeAlphanumericSegment(o,i,m,l);break;case ke.BYTE:Te.decodeByteSegment(o,i,m,n,a,r);break;case ke.KANJI:Te.decodeKanjiSegment(o,i,m);break;default:throw new v}}}while(t!==ke.TERMINATOR)}catch(t){throw new v}return new Q(t,i.toString(),0===a.length?null:a,null===n?null:n.toString(),s,c)}static decodeHanziSegment(t,e,n){if(13*n>t.available())throw new v;const r=new Uint8Array(2*n);let o=0;for(;n>0;){const e=t.readBits(13);let i=e/96<<8&4294967295|e%96;i+=i<959?41377:42657,r[o]=i>>8&255,r[o+1]=255&i,o+=2,n--}try{e.append(E.decode(r,A.GB2312))}catch(t){throw new v(t)}}static decodeKanjiSegment(t,e,n){if(13*n>t.available())throw new v;const r=new Uint8Array(2*n);let o=0;for(;n>0;){const e=t.readBits(13);let i=e/192<<8&4294967295|e%192;i+=i<7936?33088:49472,r[o]=i>>8,r[o+1]=i,o+=2,n--}try{e.append(E.decode(r,A.SHIFT_JIS))}catch(t){throw new v(t)}}static decodeByteSegment(t,e,n,r,o,i){if(8*n>t.available())throw new v;const a=new Uint8Array(n);for(let e=0;e<n;e++)a[e]=t.readBits(8);let s;s=null===r?A.guessEncoding(a,i):r.getName();try{e.append(E.decode(a,s))}catch(t){throw new v(t)}o.push(a)}static toAlphaNumericChar(t){if(t>=Te.ALPHANUMERIC_CHARS.length)throw new v;return Te.ALPHANUMERIC_CHARS[t]}static decodeAlphanumericSegment(t,e,n,r){const o=e.length();for(;n>1;){if(t.available()<11)throw new v;const r=t.readBits(11);e.append(Te.toAlphaNumericChar(Math.floor(r/45))),e.append(Te.toAlphaNumericChar(r%45)),n-=2}if(1===n){if(t.available()<6)throw new v;e.append(Te.toAlphaNumericChar(t.readBits(6)))}if(r)for(let t=o;t<e.length();t++)"%"===e.charAt(t)&&(t<e.length()-1&&"%"===e.charAt(t+1)?e.deleteCharAt(t+1):e.setCharAt(t,String.fromCharCode(29)))}static decodeNumericSegment(t,e,n){for(;n>=3;){if(t.available()<10)throw new v;const r=t.readBits(10);if(r>=1e3)throw new v;e.append(Te.toAlphaNumericChar(Math.floor(r/100))),e.append(Te.toAlphaNumericChar(Math.floor(r/10)%10)),e.append(Te.toAlphaNumericChar(r%10)),n-=3}if(2===n){if(t.available()<7)throw new v;const n=t.readBits(7);if(n>=100)throw new v;e.append(Te.toAlphaNumericChar(Math.floor(n/10))),e.append(Te.toAlphaNumericChar(n%10))}else if(1===n){if(t.available()<4)throw new v;const n=t.readBits(4);if(n>=10)throw new v;e.append(Te.toAlphaNumericChar(n))}}static parseECIValue(t){const e=t.readBits(8);if(!(128&e))return 127&e;if(128==(192&e))return(63&e)<<8&4294967295|t.readBits(8);if(192==(224&e))return(31&e)<<16&4294967295|t.readBits(16);throw new v}}Te.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Te.GB2312_SUBSET=1;class Re{constructor(t){this.mirrored=t}isMirrored(){return this.mirrored}applyMirroredCorrection(t){if(!this.mirrored||null===t||t.length<3)return;const e=t[0];t[0]=t[2],t[2]=e}}class Ne{constructor(){this.rsDecoder=new nt(J.QR_CODE_FIELD_256)}decodeBooleanArray(t,e){return this.decodeBitMatrix(k.parseFromBooleanArray(t),e)}decodeBitMatrix(t,e){const n=new Ae(t);let r=null;try{return this.decodeBitMatrixParser(n,e)}catch(t){r=t}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();const t=this.decodeBitMatrixParser(n,e);return t.setOther(new Re(!0)),t}catch(t){if(null!==r)throw r;throw t}}decodeBitMatrixParser(t,e){const n=t.readVersion(),r=t.readFormatInformation().getErrorCorrectionLevel(),o=t.readCodewords(),i=Se.getDataBlocks(o,n,r);let a=0;for(const t of i)a+=t.getNumDataCodewords();const s=new Uint8Array(a);let c=0;for(const t of i){const e=t.getCodewords(),n=t.getNumDataCodewords();this.correctErrors(e,n);for(let t=0;t<n;t++)s[c++]=e[t]}return Te.decode(s,n,r,e)}correctErrors(t,e){const n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch(t){throw new h}for(let r=0;r<e;r++)t[r]=n[r]}}class De extends at{constructor(t,e,n){super(t,e),this.estimatedModuleSize=n}aboutEquals(t,e,n){if(Math.abs(e-this.getY())<=t&&Math.abs(n-this.getX())<=t){const e=Math.abs(t-this.estimatedModuleSize);return e<=1||e<=this.estimatedModuleSize}return!1}combineEstimate(t,e,n){const r=(this.getX()+e)/2,o=(this.getY()+t)/2,i=(this.estimatedModuleSize+n)/2;return new De(r,o,i)}}class xe{constructor(t,e,n,r,o,i,a){this.image=t,this.startX=e,this.startY=n,this.width=r,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const t=this.startX,e=this.height,n=t+this.width,r=this.startY+e/2,o=new Int32Array(3),i=this.image;for(let a=0;a<e;a++){const e=r+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));o[0]=0,o[1]=0,o[2]=0;let s=t;for(;s<n&&!i.get(s,e);)s++;let c=0;for(;s<n;){if(i.get(s,e))if(1===c)o[1]++;else if(2===c){if(this.foundPatternCross(o)){const t=this.handlePossibleCenter(o,e,s);if(null!==t)return t}o[0]=o[2],o[1]=1,o[2]=0,c=1}else o[++c]++;else 1===c&&c++,o[c]++;s++}if(this.foundPatternCross(o)){const t=this.handlePossibleCenter(o,e,n);if(null!==t)return t}}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new T}static centerFromEnd(t,e){return e-t[2]-t[1]/2}foundPatternCross(t){const e=this.moduleSize,n=e/2;for(let r=0;r<3;r++)if(Math.abs(e-t[r])>=n)return!1;return!0}crossCheckVertical(t,e,n,r){const o=this.image,i=o.getHeight(),a=this.crossCheckStateCount;a[0]=0,a[1]=0,a[2]=0;let s=t;for(;s>=0&&o.get(e,s)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&!o.get(e,s)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<i&&o.get(e,s)&&a[1]<=n;)a[1]++,s++;if(s===i||a[1]>n)return NaN;for(;s<i&&!o.get(e,s)&&a[2]<=n;)a[2]++,s++;if(a[2]>n)return NaN;const c=a[0]+a[1]+a[2];return 5*Math.abs(c-r)>=2*r?NaN:this.foundPatternCross(a)?xe.centerFromEnd(a,s):NaN}handlePossibleCenter(t,e,n){const r=t[0]+t[1]+t[2],o=xe.centerFromEnd(t,n),i=this.crossCheckVertical(e,o,2*t[1],r);if(!isNaN(i)){const e=(t[0]+t[1]+t[2])/3;for(const t of this.possibleCenters)if(t.aboutEquals(e,i,o))return t.combineEstimate(i,o,e);const n=new De(o,i,e);this.possibleCenters.push(n),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(n)}return null}}class Oe extends at{constructor(t,e,n,r){super(t,e),this.estimatedModuleSize=n,this.count=r,void 0===r&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(t,e,n){if(Math.abs(e-this.getY())<=t&&Math.abs(n-this.getX())<=t){const e=Math.abs(t-this.estimatedModuleSize);return e<=1||e<=this.estimatedModuleSize}return!1}combineEstimate(t,e,n){const r=this.count+1,o=(this.count*this.getX()+e)/r,i=(this.count*this.getY()+t)/r,a=(this.count*this.estimatedModuleSize+n)/r;return new Oe(o,i,a,r)}}class Me{constructor(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Pe{constructor(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(t){const e=null!=t&&void 0!==t.get(b.TRY_HARDER),n=null!=t&&void 0!==t.get(b.PURE_BARCODE),r=this.image,o=r.getHeight(),i=r.getWidth();let a=Math.floor(3*o/(4*Pe.MAX_MODULES));(a<Pe.MIN_SKIP||e)&&(a=Pe.MIN_SKIP);let s=!1;const c=new Int32Array(5);for(let t=a-1;t<o&&!s;t+=a){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;let e=0;for(let o=0;o<i;o++)if(r.get(o,t))1&~e||e++,c[e]++;else if(1&e)c[e]++;else if(4===e)if(Pe.foundPatternCross(c)){if(!0!==this.handlePossibleCenter(c,t,o,n)){c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,e=3;continue}if(a=2,!0===this.hasSkipped)s=this.haveMultiplyConfirmedCenters();else{const e=this.findRowSkip();e>c[2]&&(t+=e-c[2]-a,o=i-1)}e=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,e=3;else c[++e]++;Pe.foundPatternCross(c)&&!0===this.handlePossibleCenter(c,t,i,n)&&(a=c[0],this.hasSkipped&&(s=this.haveMultiplyConfirmedCenters()))}const l=this.selectBestPatterns();return at.orderBestPatterns(l),new Me(l)}static centerFromEnd(t,e){return e-t[4]-t[3]-t[2]/2}static foundPatternCross(t){let e=0;for(let n=0;n<5;n++){const r=t[n];if(0===r)return!1;e+=r}if(e<7)return!1;const n=e/7,r=n/2;return Math.abs(n-t[0])<r&&Math.abs(n-t[1])<r&&Math.abs(3*n-t[2])<3*r&&Math.abs(n-t[3])<r&&Math.abs(n-t[4])<r}getCrossCheckStateCount(){const t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t}crossCheckDiagonal(t,e,n,r){const o=this.getCrossCheckStateCount();let i=0;const a=this.image;for(;t>=i&&e>=i&&a.get(e-i,t-i);)o[2]++,i++;if(t<i||e<i)return!1;for(;t>=i&&e>=i&&!a.get(e-i,t-i)&&o[1]<=n;)o[1]++,i++;if(t<i||e<i||o[1]>n)return!1;for(;t>=i&&e>=i&&a.get(e-i,t-i)&&o[0]<=n;)o[0]++,i++;if(o[0]>n)return!1;const s=a.getHeight(),c=a.getWidth();for(i=1;t+i<s&&e+i<c&&a.get(e+i,t+i);)o[2]++,i++;if(t+i>=s||e+i>=c)return!1;for(;t+i<s&&e+i<c&&!a.get(e+i,t+i)&&o[3]<n;)o[3]++,i++;if(t+i>=s||e+i>=c||o[3]>=n)return!1;for(;t+i<s&&e+i<c&&a.get(e+i,t+i)&&o[4]<n;)o[4]++,i++;if(o[4]>=n)return!1;const l=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(l-r)<2*r&&Pe.foundPatternCross(o)}crossCheckVertical(t,e,n,r){const o=this.image,i=o.getHeight(),a=this.getCrossCheckStateCount();let s=t;for(;s>=0&&o.get(e,s);)a[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(e,s)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&o.get(e,s)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<i&&o.get(e,s);)a[2]++,s++;if(s===i)return NaN;for(;s<i&&!o.get(e,s)&&a[3]<n;)a[3]++,s++;if(s===i||a[3]>=n)return NaN;for(;s<i&&o.get(e,s)&&a[4]<n;)a[4]++,s++;if(a[4]>=n)return NaN;const c=a[0]+a[1]+a[2]+a[3]+a[4];return 5*Math.abs(c-r)>=2*r?NaN:Pe.foundPatternCross(a)?Pe.centerFromEnd(a,s):NaN}crossCheckHorizontal(t,e,n,r){const o=this.image,i=o.getWidth(),a=this.getCrossCheckStateCount();let s=t;for(;s>=0&&o.get(s,e);)a[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(s,e)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&o.get(s,e)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<i&&o.get(s,e);)a[2]++,s++;if(s===i)return NaN;for(;s<i&&!o.get(s,e)&&a[3]<n;)a[3]++,s++;if(s===i||a[3]>=n)return NaN;for(;s<i&&o.get(s,e)&&a[4]<n;)a[4]++,s++;if(a[4]>=n)return NaN;const c=a[0]+a[1]+a[2]+a[3]+a[4];return 5*Math.abs(c-r)>=r?NaN:Pe.foundPatternCross(a)?Pe.centerFromEnd(a,s):NaN}handlePossibleCenter(t,e,n,r){const o=t[0]+t[1]+t[2]+t[3]+t[4];let i=Pe.centerFromEnd(t,n),a=this.crossCheckVertical(e,Math.floor(i),t[2],o);if(!isNaN(a)&&(i=this.crossCheckHorizontal(Math.floor(i),Math.floor(a),t[2],o),!isNaN(i)&&(!r||this.crossCheckDiagonal(Math.floor(a),Math.floor(i),t[2],o)))){const t=o/7;let e=!1;const n=this.possibleCenters;for(let r=0,o=n.length;r<o;r++){const o=n[r];if(o.aboutEquals(t,a,i)){n[r]=o.combineEstimate(a,i,t),e=!0;break}}if(!e){const e=new Oe(i,a,t);n.push(e),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(e)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let t=null;for(const e of this.possibleCenters)if(e.getCount()>=Pe.CENTER_QUORUM){if(null!=t)return this.hasSkipped=!0,Math.floor((Math.abs(t.getX()-e.getX())-Math.abs(t.getY()-e.getY()))/2);t=e}return 0}haveMultiplyConfirmedCenters(){let t=0,e=0;const n=this.possibleCenters.length;for(const n of this.possibleCenters)n.getCount()>=Pe.CENTER_QUORUM&&(t++,e+=n.getEstimatedModuleSize());if(t<3)return!1;const r=e/n;let o=0;for(const t of this.possibleCenters)o+=Math.abs(t.getEstimatedModuleSize()-r);return o<=.05*e}selectBestPatterns(){const t=this.possibleCenters.length;if(t<3)throw new T;const e=this.possibleCenters;let n;if(t>3){let r=0,o=0;for(const t of this.possibleCenters){const e=t.getEstimatedModuleSize();r+=e,o+=e*e}n=r/t;let i=Math.sqrt(o/t-n*n);e.sort((t,e)=>{const r=Math.abs(e.getEstimatedModuleSize()-n),o=Math.abs(t.getEstimatedModuleSize()-n);return r<o?-1:r>o?1:0});const a=Math.max(.2*n,i);for(let t=0;t<e.length&&e.length>3;t++){const r=e[t];Math.abs(r.getEstimatedModuleSize()-n)>a&&(e.splice(t,1),t--)}}if(e.length>3){let t=0;for(const n of e)t+=n.getEstimatedModuleSize();n=t/e.length,e.sort((t,e)=>{if(e.getCount()===t.getCount()){const r=Math.abs(e.getEstimatedModuleSize()-n),o=Math.abs(t.getEstimatedModuleSize()-n);return r<o?1:r>o?-1:0}return e.getCount()-t.getCount()}),e.splice(3)}return[e[0],e[1],e[2]]}}Pe.CENTER_QUORUM=2,Pe.MIN_SKIP=3,Pe.MAX_MODULES=57;class Be{constructor(t){this.image=t}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(t){this.resultPointCallback=null==t?null:t.get(b.NEED_RESULT_POINT_CALLBACK);const e=new Pe(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)}processFinderPatternInfo(t){const e=t.getTopLeft(),n=t.getTopRight(),r=t.getBottomLeft(),o=this.calculateModuleSize(e,n,r);if(o<1)throw new T("No pattern found in proccess finder.");const i=Be.computeDimension(e,n,r,o),a=Ce.getProvisionalVersionForDimension(i),s=a.getDimensionForVersion()-7;let c=null;if(a.getAlignmentPatternCenters().length>0){const t=n.getX()-e.getX()+r.getX(),i=n.getY()-e.getY()+r.getY(),a=1-3/s,l=Math.floor(e.getX()+a*(t-e.getX())),d=Math.floor(e.getY()+a*(i-e.getY()));for(let t=4;t<=16;t<<=1)try{c=this.findAlignmentInRegion(o,l,d,t);break}catch(t){if(!(t instanceof T))throw t}}const l=Be.createTransform(e,n,r,c,i),d=Be.sampleGrid(this.image,l,i);let u;return u=null===c?[r,e,n]:[r,e,n,c],new st(d,u)}static createTransform(t,e,n,r,o){const i=o-3.5;let a,s,c,l;return null!==r?(a=r.getX(),s=r.getY(),c=i-3,l=c):(a=e.getX()-t.getX()+n.getX(),s=e.getY()-t.getY()+n.getY(),c=i,l=i),ut.quadrilateralToQuadrilateral(3.5,3.5,i,3.5,c,l,3.5,i,t.getX(),t.getY(),e.getX(),e.getY(),a,s,n.getX(),n.getY())}static sampleGrid(t,e,n){return mt.getInstance().sampleGridWithTransform(t,n,n,e)}static computeDimension(t,e,n,r){const o=ot.round(at.distance(t,e)/r),i=ot.round(at.distance(t,n)/r);let a=Math.floor((o+i)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new T("Dimensions could be not found.")}return a}calculateModuleSize(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2}calculateModuleSizeOneWay(t,e){const n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14}sizeOfBlackWhiteBlackRunBothWays(t,e,n,r){let o=this.sizeOfBlackWhiteBlackRun(t,e,n,r),i=1,a=t-(n-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);let s=Math.floor(e-(r-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s),o-1}sizeOfBlackWhiteBlackRun(t,e,n,r){const o=Math.abs(r-e)>Math.abs(n-t);if(o){let o=t;t=e,e=o,o=n,n=r,r=o}const i=Math.abs(n-t),a=Math.abs(r-e);let s=-i/2;const c=t<n?1:-1,l=e<r?1:-1;let d=0;const u=n+c;for(let n=t,h=e;n!==u;n+=c){const c=o?h:n,u=o?n:h;if(1===d===this.image.get(c,u)){if(2===d)return ot.distance(n,h,t,e);d++}if(s+=a,s>0){if(h===r)break;h+=l,s-=i}}return 2===d?ot.distance(n+c,r,t,e):NaN}findAlignmentInRegion(t,e,n,r){const o=Math.floor(r*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new T("Alignment top exceeds estimated module size.");const s=Math.max(0,n-o),c=Math.min(this.image.getHeight()-1,n+o);if(c-s<3*t)throw new T("Alignment bottom exceeds estimated module size.");return new xe(this.image,i,s,a-i,c-s,t,this.resultPointCallback).find()}}class Fe{constructor(){this.decoder=new Ne}getDecoder(){return this.decoder}decode(t,e){let n,r;if(null!=e&&void 0!==e.get(b.PURE_BARCODE)){const o=Fe.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(o,e),r=Fe.NO_POINTS}else{const o=new Be(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(o.getBits(),e),r=o.getPoints()}n.getOther()instanceof Re&&n.getOther().applyMirroredCorrection(r);const o=new L(n.getText(),n.getRawBytes(),void 0,r,V.QR_CODE,void 0),i=n.getByteSegments();null!==i&&o.putMetadata(X.BYTE_SEGMENTS,i);const a=n.getECLevel();return null!==a&&o.putMetadata(X.ERROR_CORRECTION_LEVEL,a),n.hasStructuredAppend()&&(o.putMetadata(X.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),o.putMetadata(X.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),o}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(null===e||null===n)throw new T;const r=this.moduleSize(e,t);let o=e[1],i=n[1],a=e[0],s=n[0];if(a>=s||o>=i)throw new T;if(i-o!==s-a&&(s=a+(i-o),s>=t.getWidth()))throw new T;const c=Math.round((s-a+1)/r),l=Math.round((i-o+1)/r);if(c<=0||l<=0)throw new T;if(l!==c)throw new T;const d=Math.floor(r/2);o+=d,a+=d;const u=a+Math.floor((c-1)*r)-s;if(u>0){if(u>d)throw new T;a-=u}const h=o+Math.floor((l-1)*r)-i;if(h>0){if(h>d)throw new T;o-=h}const m=new k(c,l);for(let e=0;e<l;e++){const n=o+Math.floor(e*r);for(let o=0;o<c;o++)t.get(a+Math.floor(o*r),n)&&m.set(o,e)}return m}static moduleSize(t,e){const n=e.getHeight(),r=e.getWidth();let o=t[0],i=t[1],a=!0,s=0;for(;o<r&&i<n;){if(a!==e.get(o,i)){if(5===++s)break;a=!a}o++,i++}if(o===r||i===n)throw new T;return(o-t[0])/7}}Fe.NO_POINTS=new Array;class Le{PDF417Common(){}static getBitCountSum(t){return ot.sum(t)}static toIntArray(t){if(null==t||!t.length)return Le.EMPTY_INT_ARRAY;const e=new Int32Array(t.length);let n=0;for(const r of t)e[n++]=r;return e}static getCodeword(t){const e=g.binarySearch(Le.SYMBOL_TABLE,262143&t);return e<0?-1:(Le.CODEWORD_TABLE[e]-1)%Le.NUMBER_OF_CODEWORDS}}Le.NUMBER_OF_CODEWORDS=929,Le.MAX_CODEWORDS_IN_BARCODE=Le.NUMBER_OF_CODEWORDS-1,Le.MIN_ROWS_IN_BARCODE=3,Le.MAX_ROWS_IN_BARCODE=90,Le.MODULES_IN_CODEWORD=17,Le.MODULES_IN_STOP_PATTERN=18,Le.BARS_IN_MODULE=8,Le.EMPTY_INT_ARRAY=new Int32Array([]),Le.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),Le.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class qe{constructor(t,e){this.bits=t,this.points=e}getBits(){return this.bits}getPoints(){return this.points}}class Ve{static detectMultiple(t,e,n){let r=t.getBlackMatrix(),o=Ve.detect(n,r);return o.length||(r=r.clone(),r.rotate180(),o=Ve.detect(n,r)),new qe(r,o)}static detect(t,e){const n=new Array;let r=0,o=0,i=!1;for(;r<e.getHeight();){const a=Ve.findVertices(e,r,o);if(null!=a[0]||null!=a[3]){if(i=!0,n.push(a),!t)break;null!=a[2]?(o=Math.trunc(a[2].getX()),r=Math.trunc(a[2].getY())):(o=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY()))}else{if(!i)break;i=!1,o=0;for(const t of n)null!=t[1]&&(r=Math.trunc(Math.max(r,t[1].getY()))),null!=t[3]&&(r=Math.max(r,Math.trunc(t[3].getY())));r+=Ve.ROW_STEP}}return n}static findVertices(t,e,n){const r=t.getHeight(),o=t.getWidth(),i=new Array(8);return Ve.copyToResult(i,Ve.findRowsWithPattern(t,r,o,e,n,Ve.START_PATTERN),Ve.INDEXES_START_PATTERN),null!=i[4]&&(n=Math.trunc(i[4].getX()),e=Math.trunc(i[4].getY())),Ve.copyToResult(i,Ve.findRowsWithPattern(t,r,o,e,n,Ve.STOP_PATTERN),Ve.INDEXES_STOP_PATTERN),i}static copyToResult(t,e,n){for(let r=0;r<n.length;r++)t[n[r]]=e[r]}static findRowsWithPattern(t,e,n,r,o,i){const a=new Array(4);let s=!1;const c=new Int32Array(i.length);for(;r<e;r+=Ve.ROW_STEP){let e=Ve.findGuardPattern(t,o,r,n,!1,i,c);if(null!=e){for(;r>0;){const a=Ve.findGuardPattern(t,o,--r,n,!1,i,c);if(null==a){r++;break}e=a}a[0]=new at(e[0],r),a[1]=new at(e[1],r),s=!0;break}}let l=r+1;if(s){let r=0,o=Int32Array.from([Math.trunc(a[0].getX()),Math.trunc(a[1].getX())]);for(;l<e;l++){const e=Ve.findGuardPattern(t,o[0],l,n,!1,i,c);if(null!=e&&Math.abs(o[0]-e[0])<Ve.MAX_PATTERN_DRIFT&&Math.abs(o[1]-e[1])<Ve.MAX_PATTERN_DRIFT)o=e,r=0;else{if(r>Ve.SKIPPED_ROW_COUNT_MAX)break;r++}}l-=r+1,a[2]=new at(o[0],l),a[3]=new at(o[1],l)}return l-r<Ve.BARCODE_MIN_HEIGHT&&g.fill(a,null),a}static findGuardPattern(t,e,n,r,o,i,a){g.fillWithin(a,0,a.length,0);let s=e,c=0;for(;t.get(s,n)&&s>0&&c++<Ve.MAX_PIXEL_DRIFT;)s--;let l=s,d=0,u=i.length;for(let e=o;l<r;l++)if(t.get(l,n)!==e)a[d]++;else{if(d===u-1){if(Ve.patternMatchVariance(a,i,Ve.MAX_INDIVIDUAL_VARIANCE)<Ve.MAX_AVG_VARIANCE)return new Int32Array([s,l]);s+=a[0]+a[1],f.arraycopy(a,2,a,0,d-1),a[d-1]=0,a[d]=0,d--}else d++;a[d]=1,e=!e}return d===u-1&&Ve.patternMatchVariance(a,i,Ve.MAX_INDIVIDUAL_VARIANCE)<Ve.MAX_AVG_VARIANCE?new Int32Array([s,l-1]):null}static patternMatchVariance(t,e,n){let r=t.length,o=0,i=0;for(let n=0;n<r;n++)o+=t[n],i+=e[n];if(o<i)return 1/0;let a=o/i;n*=a;let s=0;for(let o=0;o<r;o++){let r=t[o],i=e[o]*a,c=r>i?r-i:i-r;if(c>n)return 1/0;s+=c}return s/o}}Ve.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Ve.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Ve.MAX_AVG_VARIANCE=.42,Ve.MAX_INDIVIDUAL_VARIANCE=.8,Ve.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Ve.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Ve.MAX_PIXEL_DRIFT=3,Ve.MAX_PATTERN_DRIFT=5,Ve.SKIPPED_ROW_COUNT_MAX=25,Ve.ROW_STEP=5,Ve.BARCODE_MIN_HEIGHT=10;class He{constructor(t,e){if(0===e.length)throw new d;this.field=t;let n=e.length;if(n>1&&0===e[0]){let t=1;for(;t<n&&0===e[t];)t++;t===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-t),f.arraycopy(e,t,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(0===t)return this.getCoefficient(0);if(1===t){let t=0;for(let e of this.coefficients)t=this.field.add(t,e);return t}let e=this.coefficients[0],n=this.coefficients.length;for(let r=1;r<n;r++)e=this.field.add(this.field.multiply(t,e),this.coefficients[r]);return e}add(t){if(!this.field.equals(t.field))throw new d("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;let e=this.coefficients,n=t.coefficients;if(e.length>n.length){let t=e;e=n,n=t}let r=new Int32Array(n.length),o=n.length-e.length;f.arraycopy(n,0,r,0,o);for(let t=o;t<n.length;t++)r[t]=this.field.add(e[t-o],n[t]);return new He(this.field,r)}subtract(t){if(!this.field.equals(t.field))throw new d("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())}multiply(t){return t instanceof He?this.multiplyOther(t):this.multiplyScalar(t)}multiplyOther(t){if(!this.field.equals(t.field))throw new d("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new He(this.field,new Int32Array([0]));let e=this.coefficients,n=e.length,r=t.coefficients,o=r.length,i=new Int32Array(n+o-1);for(let t=0;t<n;t++){let n=e[t];for(let e=0;e<o;e++)i[t+e]=this.field.add(i[t+e],this.field.multiply(n,r[e]))}return new He(this.field,i)}negative(){let t=this.coefficients.length,e=new Int32Array(t);for(let n=0;n<t;n++)e[n]=this.field.subtract(0,this.coefficients[n]);return new He(this.field,e)}multiplyScalar(t){if(0===t)return new He(this.field,new Int32Array([0]));if(1===t)return this;let e=this.coefficients.length,n=new Int32Array(e);for(let r=0;r<e;r++)n[r]=this.field.multiply(this.coefficients[r],t);return new He(this.field,n)}multiplyByMonomial(t,e){if(t<0)throw new d;if(0===e)return new He(this.field,new Int32Array([0]));let n=this.coefficients.length,r=new Int32Array(n+t);for(let t=0;t<n;t++)r[t]=this.field.multiply(this.coefficients[t],e);return new He(this.field,r)}toString(){let t=new S;for(let e=this.getDegree();e>=0;e--){let n=this.getCoefficient(e);0!==n&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),0!==e&&1===n||t.append(n),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()}}class Ue{add(t,e){return(t+e)%this.modulus}subtract(t,e){return(this.modulus+t-e)%this.modulus}exp(t){return this.expTable[t]}log(t){if(0===t)throw new d;return this.logTable[t]}inverse(t){if(0===t)throw new K;return this.expTable[this.modulus-this.logTable[t]-1]}multiply(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]}getSize(){return this.modulus}equals(t){return t===this}}class ze extends Ue{constructor(t,e){super(),this.modulus=t,this.expTable=new Int32Array(t),this.logTable=new Int32Array(t);let n=1;for(let r=0;r<t;r++)this.expTable[r]=n,n=n*e%t;for(let e=0;e<t-1;e++)this.logTable[this.expTable[e]]=e;this.zero=new He(this,new Int32Array([0])),this.one=new He(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,e){if(t<0)throw new d;if(0===e)return this.zero;let n=new Int32Array(t+1);return n[0]=e,new He(this,n)}}ze.PDF417_GF=new ze(Le.NUMBER_OF_CODEWORDS,3);class We{constructor(){this.field=ze.PDF417_GF}decode(t,e,n){let r=new He(this.field,t),o=new Int32Array(e),i=!1;for(let t=e;t>0;t--){let n=r.evaluateAt(this.field.exp(t));o[e-t]=n,0!==n&&(i=!0)}if(!i)return 0;let a=this.field.getOne();if(null!=n)for(const e of n){let n=this.field.exp(t.length-1-e),r=new He(this.field,new Int32Array([this.field.subtract(0,n),1]));a=a.multiply(r)}let s=new He(this.field,o),c=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),s,e),l=c[0],d=c[1],u=this.findErrorLocations(l),m=this.findErrorMagnitudes(d,l,u);for(let e=0;e<u.length;e++){let n=t.length-1-this.field.log(u[e]);if(n<0)throw h.getChecksumInstance();t[n]=this.field.subtract(t[n],m[e])}return u.length}runEuclideanAlgorithm(t,e,n){if(t.getDegree()<e.getDegree()){let n=t;t=e,e=n}let r=t,o=e,i=this.field.getZero(),a=this.field.getOne();for(;o.getDegree()>=Math.round(n/2);){let t=r,e=i;if(r=o,i=a,r.isZero())throw h.getChecksumInstance();o=t;let n=this.field.getZero(),s=r.getCoefficient(r.getDegree()),c=this.field.inverse(s);for(;o.getDegree()>=r.getDegree()&&!o.isZero();){let t=o.getDegree()-r.getDegree(),e=this.field.multiply(o.getCoefficient(o.getDegree()),c);n=n.add(this.field.buildMonomial(t,e)),o=o.subtract(r.multiplyByMonomial(t,e))}a=n.multiply(i).subtract(e).negative()}let s=a.getCoefficient(0);if(0===s)throw h.getChecksumInstance();let c=this.field.inverse(s);return[a.multiply(c),o.multiply(c)]}findErrorLocations(t){let e=t.getDegree(),n=new Int32Array(e),r=0;for(let o=1;o<this.field.getSize()&&r<e;o++)0===t.evaluateAt(o)&&(n[r]=this.field.inverse(o),r++);if(r!==e)throw h.getChecksumInstance();return n}findErrorMagnitudes(t,e,n){let r=e.getDegree(),o=new Int32Array(r);for(let t=1;t<=r;t++)o[r-t]=this.field.multiply(t,e.getCoefficient(t));let i=new He(this.field,o),a=n.length,s=new Int32Array(a);for(let e=0;e<a;e++){let r=this.field.inverse(n[e]),o=this.field.subtract(0,t.evaluateAt(r)),a=this.field.inverse(i.evaluateAt(r));s[e]=this.field.multiply(o,a)}return s}}class je{constructor(t,e,n,r,o){t instanceof je?this.constructor_2(t):this.constructor_1(t,e,n,r,o)}constructor_1(t,e,n,r,o){const i=null==e||null==n,a=null==r||null==o;if(i&&a)throw new T;i?(e=new at(0,r.getY()),n=new at(0,o.getY())):a&&(r=new at(t.getWidth()-1,e.getY()),o=new at(t.getWidth()-1,n.getY())),this.image=t,this.topLeft=e,this.bottomLeft=n,this.topRight=r,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),o.getY()))}constructor_2(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()}static merge(t,e){return null==t?e:null==e?t:new je(t.image,t.topLeft,t.bottomLeft,e.topRight,e.bottomRight)}addMissingRows(t,e,n){let r=this.topLeft,o=this.bottomLeft,i=this.topRight,a=this.bottomRight;if(t>0){let e=n?this.topLeft:this.topRight,o=Math.trunc(e.getY()-t);o<0&&(o=0);let a=new at(e.getX(),o);n?r=a:i=a}if(e>0){let t=n?this.bottomLeft:this.bottomRight,r=Math.trunc(t.getY()+e);r>=this.image.getHeight()&&(r=this.image.getHeight()-1);let i=new at(t.getX(),r);n?o=i:a=i}return new je(this.image,r,o,i,a)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Ge{constructor(t,e,n,r){this.columnCount=t,this.errorCorrectionLevel=r,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class Xe{constructor(){this.buffer=""}static form(t,e){let n=-1;function r(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0===e[++n])return;t=i?parseInt(i.substr(1)):void 0;let c,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":c=e[n];break;case"c":c=e[n][0];break;case"f":c=parseFloat(e[n]).toFixed(t);break;case"p":c=parseFloat(e[n]).toPrecision(t);break;case"e":c=parseFloat(e[n]).toExponential(t);break;case"x":c=parseInt(e[n]).toString(l||16);break;case"d":c=parseFloat(parseInt(e[n],l||10).toPrecision(t)).toFixed(0)}c="object"==typeof c?JSON.stringify(c):(+c).toString(l);let d=parseInt(o),u=o&&o[0]+""=="0"?"0":" ";for(;c.length<d;)c=void 0!==r?c+u:u+c;return c}let o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,r)}format(t,...e){this.buffer+=Xe.form(t,e)}toString(){return this.buffer}}class Qe{constructor(t){this.boundingBox=new je(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}getCodewordNearby(t){let e=this.getCodeword(t);if(null!=e)return e;for(let n=1;n<Qe.MAX_NEARBY_DISTANCE;n++){let r=this.imageRowToCodewordIndex(t)-n;if(r>=0&&(e=this.codewords[r],null!=e))return e;if(r=this.imageRowToCodewordIndex(t)+n,r<this.codewords.length&&(e=this.codewords[r],null!=e))return e}return null}imageRowToCodewordIndex(t){return t-this.boundingBox.getMinY()}setCodeword(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e}getCodeword(t){return this.codewords[this.imageRowToCodewordIndex(t)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const t=new Xe;let e=0;for(const n of this.codewords)null!=n?t.format("%3d: %3d|%3d%n",e++,n.getRowNumber(),n.getValue()):t.format("%3d: | %n",e++);return t.toString()}}Qe.MAX_NEARBY_DISTANCE=5;class Ye{constructor(){this.values=new Map}setValue(t){t=Math.trunc(t);let e=this.values.get(t);null==e&&(e=0),e++,this.values.set(t,e)}getValue(){let t=-1,e=new Array;for(const[n,r]of this.values.entries()){const o={getKey:()=>n,getValue:()=>r};o.getValue()>t?(t=o.getValue(),e=[],e.push(o.getKey())):o.getValue()===t&&e.push(o.getKey())}return Le.toIntArray(e)}getConfidence(t){return this.values.get(t)}}class Ze extends Qe{constructor(t,e){super(t),this._isLeft=e}setRowNumbers(){for(let t of this.getCodewords())null!=t&&t.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(t){let e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);let n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),o=this._isLeft?n.getBottomLeft():n.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=-1,c=1,l=0;for(let n=i;n<a;n++){if(null==e[n])continue;let r=e[n],o=r.getRowNumber()-s;if(0===o)l++;else if(1===o)c=Math.max(c,l),l=1,s=r.getRowNumber();else if(o<0||r.getRowNumber()>=t.getRowCount()||o>n)e[n]=null;else{let t;t=c>2?(c-2)*o:o;let i=t>=n;for(let r=1;r<=t&&!i;r++)i=null!=e[n-r];i?e[n]=null:(s=r.getRowNumber(),l=1)}}}getRowHeights(){let t=this.getBarcodeMetadata();if(null==t)return null;this.adjustIncompleteIndicatorColumnRowNumbers(t);let e=new Int32Array(t.getRowCount());for(let t of this.getCodewords())if(null!=t){let n=t.getRowNumber();if(n>=e.length)continue;e[n]++}return e}adjustIncompleteIndicatorColumnRowNumbers(t){let e=this.getBoundingBox(),n=this._isLeft?e.getTopLeft():e.getTopRight(),r=this._isLeft?e.getBottomLeft():e.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(n.getY())),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),a=this.getCodewords(),s=-1;for(let e=o;e<i;e++){if(null==a[e])continue;let n=a[e];n.setRowNumberAsRowIndicatorColumn();let r=n.getRowNumber()-s;0===r||(1===r?s=n.getRowNumber():n.getRowNumber()>=t.getRowCount()?a[e]=null:s=n.getRowNumber())}}getBarcodeMetadata(){let t=this.getCodewords(),e=new Ye,n=new Ye,r=new Ye,o=new Ye;for(let i of t){if(null==i)continue;i.setRowNumberAsRowIndicatorColumn();let t=i.getValue()%30,a=i.getRowNumber();switch(this._isLeft||(a+=2),a%3){case 0:n.setValue(3*t+1);break;case 1:o.setValue(t/3),r.setValue(t%3);break;case 2:e.setValue(t+1)}}if(0===e.getValue().length||0===n.getValue().length||0===r.getValue().length||0===o.getValue().length||e.getValue()[0]<1||n.getValue()[0]+r.getValue()[0]<Le.MIN_ROWS_IN_BARCODE||n.getValue()[0]+r.getValue()[0]>Le.MAX_ROWS_IN_BARCODE)return null;let i=new Ge(e.getValue()[0],n.getValue()[0],r.getValue()[0],o.getValue()[0]);return this.removeIncorrectCodewords(t,i),i}removeIncorrectCodewords(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(null==t[n])continue;let o=r.getValue()%30,i=r.getRowNumber();if(i>e.getRowCount())t[n]=null;else switch(this._isLeft||(i+=2),i%3){case 0:3*o+1!==e.getRowCountUpperPart()&&(t[n]=null);break;case 1:Math.trunc(o/3)===e.getErrorCorrectionLevel()&&o%3===e.getRowCountLowerPart()||(t[n]=null);break;case 2:o+1!==e.getColumnCount()&&(t[n]=null)}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+"\n"+super.toString()}}class Ke{constructor(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let t,e=Le.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e<t);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(t){null!=t&&t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let t=this.adjustRowNumbersByRow();if(0===t)return 0;for(let t=1;t<this.barcodeColumnCount+1;t++){let e=this.detectionResultColumns[t].getCodewords();for(let n=0;n<e.length;n++)null!=e[n]&&(e[n].hasValidRowNumber()||this.adjustRowNumbers(t,n,e))}return t}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(null==this.detectionResultColumns[0]||null==this.detectionResultColumns[this.barcodeColumnCount+1])return;let t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<t.length;n++)if(null!=t[n]&&null!=e[n]&&t[n].getRowNumber()===e[n].getRowNumber())for(let e=1;e<=this.barcodeColumnCount;e++){let r=this.detectionResultColumns[e].getCodewords()[n];null!=r&&(r.setRowNumber(t[n].getRowNumber()),r.hasValidRowNumber()||(this.detectionResultColumns[e].getCodewords()[n]=null))}}adjustRowNumbersFromRRI(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;let t=0,e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<e.length;n++){if(null==e[n])continue;let r=e[n].getRowNumber(),o=0;for(let e=this.barcodeColumnCount+1;e>0&&o<this.ADJUST_ROW_NUMBER_SKIP;e--){let i=this.detectionResultColumns[e].getCodewords()[n];null!=i&&(o=Ke.adjustRowNumberIfValid(r,o,i),i.hasValidRowNumber()||t++)}}return t}adjustRowNumbersFromLRI(){if(null==this.detectionResultColumns[0])return 0;let t=0,e=this.detectionResultColumns[0].getCodewords();for(let n=0;n<e.length;n++){if(null==e[n])continue;let r=e[n].getRowNumber(),o=0;for(let e=1;e<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;e++){let i=this.detectionResultColumns[e].getCodewords()[n];null!=i&&(o=Ke.adjustRowNumberIfValid(r,o,i),i.hasValidRowNumber()||t++)}}return t}static adjustRowNumberIfValid(t,e,n){return null==n||n.hasValidRowNumber()||(n.isValidRowNumber(t)?(n.setRowNumber(t),e=0):++e),e}adjustRowNumbers(t,e,n){if(!this.detectionResultColumns[t-1])return;let r=n[e],o=this.detectionResultColumns[t-1].getCodewords(),i=o;null!=this.detectionResultColumns[t+1]&&(i=this.detectionResultColumns[t+1].getCodewords());let a=new Array(14);a[2]=o[e],a[3]=i[e],e>0&&(a[0]=n[e-1],a[4]=o[e-1],a[5]=i[e-1]),e>1&&(a[8]=n[e-2],a[10]=o[e-2],a[11]=i[e-2]),e<n.length-1&&(a[1]=n[e+1],a[6]=o[e+1],a[7]=i[e+1]),e<n.length-2&&(a[9]=n[e+2],a[12]=o[e+2],a[13]=i[e+2]);for(let t of a)if(Ke.adjustRowNumber(r,t))return}static adjustRowNumber(t,e){return!(null==e||!e.hasValidRowNumber()||e.getBucket()!==t.getBucket()||(t.setRowNumber(e.getRowNumber()),0))}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(t){this.boundingBox=t}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(t,e){this.detectionResultColumns[t]=e}getDetectionResultColumn(t){return this.detectionResultColumns[t]}toString(){let t=this.detectionResultColumns[0];null==t&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);let e=new Xe;for(let n=0;n<t.getCodewords().length;n++){e.format("CW %3d:",n);for(let t=0;t<this.barcodeColumnCount+2;t++){if(null==this.detectionResultColumns[t]){e.format(" | ");continue}let r=this.detectionResultColumns[t].getCodewords()[n];null!=r?e.format(" %3d|%3d",r.getRowNumber(),r.getValue()):e.format(" | ")}e.format("%n")}return e.toString()}}class Je{constructor(t,e,n,r){this.rowNumber=Je.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(e),this.bucket=Math.trunc(n),this.value=Math.trunc(r)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(t){return t!==Je.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(t){this.rowNumber=t}toString(){return this.rowNumber+"|"+this.value}}Je.BARCODE_ROW_UNKNOWN=-1;class tn{static initialize(){for(let t=0;t<Le.SYMBOL_TABLE.length;t++){let e=Le.SYMBOL_TABLE[t],n=1&e;for(let r=0;r<Le.BARS_IN_MODULE;r++){let o=0;for(;(1&e)===n;)o+=1,e>>=1;n=1&e,tn.RATIOS_TABLE[t]||(tn.RATIOS_TABLE[t]=new Array(Le.BARS_IN_MODULE)),tn.RATIOS_TABLE[t][Le.BARS_IN_MODULE-r-1]=Math.fround(o/Le.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(t){let e=tn.getDecodedCodewordValue(tn.sampleBitCounts(t));return-1!==e?e:tn.getClosestDecodedValue(t)}static sampleBitCounts(t){let e=ot.sum(t),n=new Int32Array(Le.BARS_IN_MODULE),r=0,o=0;for(let i=0;i<Le.MODULES_IN_CODEWORD;i++){let a=e/(2*Le.MODULES_IN_CODEWORD)+i*e/Le.MODULES_IN_CODEWORD;o+t[r]<=a&&(o+=t[r],r++),n[r]++}return n}static getDecodedCodewordValue(t){let e=tn.getBitValue(t);return-1===Le.getCodeword(e)?-1:e}static getBitValue(t){let e=0;for(let n=0;n<t.length;n++)for(let r=0;r<t[n];r++)e=e<<1|(n%2==0?1:0);return Math.trunc(e)}static getClosestDecodedValue(t){let e=ot.sum(t),n=new Array(Le.BARS_IN_MODULE);if(e>1)for(let r=0;r<n.length;r++)n[r]=Math.fround(t[r]/e);let r=it.MAX_VALUE,o=-1;this.bSymbolTableReady||tn.initialize();for(let t=0;t<tn.RATIOS_TABLE.length;t++){let e=0,i=tn.RATIOS_TABLE[t];for(let t=0;t<Le.BARS_IN_MODULE;t++){let o=Math.fround(i[t]-n[t]);if(e+=Math.fround(o*o),e>=r)break}e<r&&(r=e,o=Le.SYMBOL_TABLE[t])}return o}}tn.bSymbolTableReady=!1,tn.RATIOS_TABLE=new Array(Le.SYMBOL_TABLE.length).map(t=>new Array(Le.BARS_IN_MODULE));class en{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(t){this.segmentIndex=t}getFileId(){return this.fileId}setFileId(t){this.fileId=t}getOptionalData(){return this.optionalData}setOptionalData(t){this.optionalData=t}isLastSegment(){return this.lastSegment}setLastSegment(t){this.lastSegment=t}getSegmentCount(){return this.segmentCount}setSegmentCount(t){this.segmentCount=t}getSender(){return this.sender||null}setSender(t){this.sender=t}getAddressee(){return this.addressee||null}setAddressee(t){this.addressee=t}getFileName(){return this.fileName}setFileName(t){this.fileName=t}getFileSize(){return this.fileSize}setFileSize(t){this.fileSize=t}getChecksum(){return this.checksum}setChecksum(t){this.checksum=t}getTimestamp(){return this.timestamp}setTimestamp(t){this.timestamp=t}}class nn{static parseLong(t,e=void 0){return parseInt(t,e)}}class rn extends c{}rn.kind="NullPointerException";class on{writeBytes(t){this.writeBytesOffset(t,0,t.length)}writeBytesOffset(t,e,n){if(null==t)throw new rn;if(e<0||e>t.length||n<0||e+n>t.length||e+n<0)throw new p;if(0!==n)for(let r=0;r<n;r++)this.write(t[e+r])}flush(){}close(){}}class an extends c{}class sn extends on{constructor(t=32){if(super(),this.count=0,t<0)throw new d("Negative initial size: "+t);this.buf=new Uint8Array(t)}ensureCapacity(t){t-this.buf.length>0&&this.grow(t)}grow(t){let e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new an;e=w.MAX_VALUE}this.buf=g.copyOfUint8Array(this.buf,e)}write(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1}writeBytesOffset(t,e,n){if(e<0||e>t.length||n<0||e+n-t.length>0)throw new p;this.ensureCapacity(this.count+n),f.arraycopy(t,e,this.buf,this.count,n),this.count+=n}writeTo(t){t.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return g.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(t){return new String(this.buf).toString()}toString_number(t){return new String(this.buf).toString()}close(){}}function cn(){if("undefined"!=typeof window)return window.BigInt||null;if(void 0!==commonjsGlobal)return commonjsGlobal.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let ln;function dn(t){if(void 0===ln&&(ln=cn()),null===ln)throw new Error("BigInt is not supported!");return ln(t)}function un(){let t=[];t[0]=dn(1);let e=dn(900);t[1]=e;for(let n=2;n<16;n++)t[n]=t[n-1]*e;return t}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(G||(G={}));class hn{static decode(t,e){let n=new S(""),r=I.ISO8859_1;n.enableDecoding(r);let o=1,i=t[o++],a=new en;for(;o<t[0];){switch(i){case hn.TEXT_COMPACTION_MODE_LATCH:o=hn.textCompaction(t,o,n);break;case hn.BYTE_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:o=hn.byteCompaction(i,t,r,o,n);break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[o++]);break;case hn.NUMERIC_COMPACTION_MODE_LATCH:o=hn.numericCompaction(t,o,n);break;case hn.ECI_CHARSET:I.getCharacterSetECIByValue(t[o++]);break;case hn.ECI_GENERAL_PURPOSE:o+=2;break;case hn.ECI_USER_DEFINED:o++;break;case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=hn.decodeMacroBlock(t,o,a);break;case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:throw new v;default:o--,o=hn.textCompaction(t,o,n)}if(!(o<t.length))throw v.getFormatInstance();i=t[o++]}if(0===n.length())throw v.getFormatInstance();let s=new Q(null,n.toString(),null,e);return s.setOther(a),s}static decodeMacroBlock(t,e,n){if(e+hn.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw v.getFormatInstance();let r=new Int32Array(hn.NUMBER_OF_SEQUENCE_CODEWORDS);for(let n=0;n<hn.NUMBER_OF_SEQUENCE_CODEWORDS;n++,e++)r[n]=t[e];n.setSegmentIndex(w.parseInt(hn.decodeBase900toBase10(r,hn.NUMBER_OF_SEQUENCE_CODEWORDS)));let o=new S;e=hn.textCompaction(t,e,o),n.setFileId(o.toString());let i=-1;for(t[e]===hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(i=e+1);e<t[0];)switch(t[e]){case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t[++e]){case hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let r=new S;e=hn.textCompaction(t,e+1,r),n.setFileName(r.toString());break;case hn.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let o=new S;e=hn.textCompaction(t,e+1,o),n.setSender(o.toString());break;case hn.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let i=new S;e=hn.textCompaction(t,e+1,i),n.setAddressee(i.toString());break;case hn.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let a=new S;e=hn.numericCompaction(t,e+1,a),n.setSegmentCount(w.parseInt(a.toString()));break;case hn.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let s=new S;e=hn.numericCompaction(t,e+1,s),n.setTimestamp(nn.parseLong(s.toString()));break;case hn.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let c=new S;e=hn.numericCompaction(t,e+1,c),n.setChecksum(w.parseInt(c.toString()));break;case hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let l=new S;e=hn.numericCompaction(t,e+1,l),n.setFileSize(nn.parseLong(l.toString()));break;default:throw v.getFormatInstance()}break;case hn.MACRO_PDF417_TERMINATOR:e++,n.setLastSegment(!0);break;default:throw v.getFormatInstance()}if(-1!==i){let r=e-i;n.isLastSegment()&&r--,n.setOptionalData(g.copyOfRange(t,i,i+r))}return e}static textCompaction(t,e,n){let r=new Int32Array(2*(t[0]-e)),o=new Int32Array(2*(t[0]-e)),i=0,a=!1;for(;e<t[0]&&!a;){let n=t[e++];if(n<hn.TEXT_COMPACTION_MODE_LATCH)r[i]=n/30,r[i+1]=n%30,i+=2;else switch(n){case hn.TEXT_COMPACTION_MODE_LATCH:r[i++]=hn.TEXT_COMPACTION_MODE_LATCH;break;case hn.BYTE_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.NUMERIC_COMPACTION_MODE_LATCH:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:e--,a=!0;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r[i]=hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,n=t[e++],o[i]=n,i++}}return hn.decodeTextCompaction(r,o,i,n),e}static decodeTextCompaction(t,e,n,r){let o=G.ALPHA,i=G.ALPHA,a=0;for(;a<n;){let n=t[a],s="";switch(o){case G.ALPHA:if(n<26)s=String.fromCharCode(65+n);else switch(n){case 26:s=" ";break;case hn.LL:o=G.LOWER;break;case hn.ML:o=G.MIXED;break;case hn.PS:i=o,o=G.PUNCT_SHIFT;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.LOWER:if(n<26)s=String.fromCharCode(97+n);else switch(n){case 26:s=" ";break;case hn.AS:i=o,o=G.ALPHA_SHIFT;break;case hn.ML:o=G.MIXED;break;case hn.PS:i=o,o=G.PUNCT_SHIFT;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.MIXED:if(n<hn.PL)s=hn.MIXED_CHARS[n];else switch(n){case hn.PL:o=G.PUNCT;break;case 26:s=" ";break;case hn.LL:o=G.LOWER;break;case hn.AL:o=G.ALPHA;break;case hn.PS:i=o,o=G.PUNCT_SHIFT;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.PUNCT:if(n<hn.PAL)s=hn.PUNCT_CHARS[n];else switch(n){case hn.PAL:o=G.ALPHA;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.ALPHA_SHIFT:if(o=i,n<26)s=String.fromCharCode(65+n);else switch(n){case 26:s=" ";break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.PUNCT_SHIFT:if(o=i,n<hn.PAL)s=hn.PUNCT_CHARS[n];else switch(n){case hn.PAL:o=G.ALPHA;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}}""!==s&&r.append(s),a++}}static byteCompaction(t,e,n,r,o){let i=new sn,a=0,s=0,c=!1;switch(t){case hn.BYTE_COMPACTION_MODE_LATCH:let t=new Int32Array(6),n=e[r++];for(;r<e[0]&&!c;)switch(t[a++]=n,s=900*s+n,n=e[r++],n){case hn.TEXT_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH:case hn.NUMERIC_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:r--,c=!0;break;default:if(a%5==0&&a>0){for(let t=0;t<6;++t)i.write(Number(dn(s)>>dn(8*(5-t))));s=0,a=0}}r===e[0]&&n<hn.TEXT_COMPACTION_MODE_LATCH&&(t[a++]=n);for(let e=0;e<a;e++)i.write(t[e]);break;case hn.BYTE_COMPACTION_MODE_LATCH_6:for(;r<e[0]&&!c;){let t=e[r++];if(t<hn.TEXT_COMPACTION_MODE_LATCH)a++,s=900*s+t;else switch(t){case hn.TEXT_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH:case hn.NUMERIC_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:r--,c=!0}if(a%5==0&&a>0){for(let t=0;t<6;++t)i.write(Number(dn(s)>>dn(8*(5-t))));s=0,a=0}}}return o.append(E.decode(i.toByteArray(),n)),r}static numericCompaction(t,e,n){let r=0,o=!1,i=new Int32Array(hn.MAX_NUMERIC_CODEWORDS);for(;e<t[0]&&!o;){let a=t[e++];if(e===t[0]&&(o=!0),a<hn.TEXT_COMPACTION_MODE_LATCH)i[r]=a,r++;else switch(a){case hn.TEXT_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:e--,o=!0}(r%hn.MAX_NUMERIC_CODEWORDS===0||a===hn.NUMERIC_COMPACTION_MODE_LATCH||o)&&r>0&&(n.append(hn.decodeBase900toBase10(i,r)),r=0)}return e}static decodeBase900toBase10(t,e){let n=dn(0);for(let r=0;r<e;r++)n+=hn.EXP900[e-r-1]*dn(t[r]);let r=n.toString();if("1"!==r.charAt(0))throw new v;return r.substring(1)}}hn.TEXT_COMPACTION_MODE_LATCH=900,hn.BYTE_COMPACTION_MODE_LATCH=901,hn.NUMERIC_COMPACTION_MODE_LATCH=902,hn.BYTE_COMPACTION_MODE_LATCH_6=924,hn.ECI_USER_DEFINED=925,hn.ECI_GENERAL_PURPOSE=926,hn.ECI_CHARSET=927,hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,hn.MACRO_PDF417_TERMINATOR=922,hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,hn.MAX_NUMERIC_CODEWORDS=15,hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,hn.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,hn.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,hn.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,hn.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,hn.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,hn.PL=25,hn.LL=27,hn.AS=27,hn.ML=28,hn.AL=28,hn.PS=29,hn.PAL=29,hn.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",hn.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",hn.EXP900=cn()?un():[],hn.NUMBER_OF_SEQUENCE_CODEWORDS=2;class mn{constructor(){}static decode(t,e,n,r,o,i,a){let s,c=new je(t,e,n,r,o),l=null,d=null;for(let n=!0;;n=!1){if(null!=e&&(l=mn.getRowIndicatorColumn(t,c,e,!0,i,a)),null!=r&&(d=mn.getRowIndicatorColumn(t,c,r,!1,i,a)),s=mn.merge(l,d),null==s)throw T.getNotFoundInstance();let o=s.getBoundingBox();if(!n||null==o||!(o.getMinY()<c.getMinY()||o.getMaxY()>c.getMaxY()))break;c=o}s.setBoundingBox(c);let u=s.getBarcodeColumnCount()+1;s.setDetectionResultColumn(0,l),s.setDetectionResultColumn(u,d);let h=null!=l;for(let e=1;e<=u;e++){let n,r=h?e:u-e;if(void 0!==s.getDetectionResultColumn(r))continue;n=0===r||r===u?new Ze(c,0===r):new Qe(c),s.setDetectionResultColumn(r,n);let o=-1,l=o;for(let e=c.getMinY();e<=c.getMaxY();e++){if(o=mn.getStartColumn(s,r,e,h),o<0||o>c.getMaxX()){if(-1===l)continue;o=l}let d=mn.detectCodeword(t,c.getMinX(),c.getMaxX(),h,o,e,i,a);null!=d&&(n.setCodeword(e,d),l=o,i=Math.min(i,d.getWidth()),a=Math.max(a,d.getWidth()))}}return mn.createDecoderResult(s)}static merge(t,e){if(null==t&&null==e)return null;let n=mn.getBarcodeMetadata(t,e);if(null==n)return null;let r=je.merge(mn.adjustBoundingBox(t),mn.adjustBoundingBox(e));return new Ke(n,r)}static adjustBoundingBox(t){if(null==t)return null;let e=t.getRowHeights();if(null==e)return null;let n=mn.getMax(e),r=0;for(let t of e)if(r+=n-t,t>0)break;let o=t.getCodewords();for(let t=0;r>0&&null==o[t];t++)r--;let i=0;for(let t=e.length-1;t>=0&&(i+=n-e[t],!(e[t]>0));t--);for(let t=o.length-1;i>0&&null==o[t];t--)i--;return t.getBoundingBox().addMissingRows(r,i,t.isLeft())}static getMax(t){let e=-1;for(let n of t)e=Math.max(e,n);return e}static getBarcodeMetadata(t,e){let n,r;return null==t||null==(n=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(r=e.getBarcodeMetadata())?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n}static getRowIndicatorColumn(t,e,n,r,o,i){let a=new Ze(e,r);for(let s=0;s<2;s++){let c=0===s?1:-1,l=Math.trunc(Math.trunc(n.getX()));for(let s=Math.trunc(Math.trunc(n.getY()));s<=e.getMaxY()&&s>=e.getMinY();s+=c){let e=mn.detectCodeword(t,0,t.getWidth(),r,l,s,o,i);null!=e&&(a.setCodeword(s,e),l=r?e.getStartX():e.getEndX())}}return a}static adjustCodewordCount(t,e){let n=e[0][1],r=n.getValue(),o=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-mn.getNumberOfECCodeWords(t.getBarcodeECLevel());if(0===r.length){if(o<1||o>Le.MAX_CODEWORDS_IN_BARCODE)throw T.getNotFoundInstance();n.setValue(o)}else r[0]!==o&&n.setValue(o)}static createDecoderResult(t){let e=mn.createBarcodeMatrix(t);mn.adjustCodewordCount(t,e);let n=new Array,r=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),o=[],i=new Array;for(let a=0;a<t.getBarcodeRowCount();a++)for(let s=0;s<t.getBarcodeColumnCount();s++){let c=e[a][s+1].getValue(),l=a*t.getBarcodeColumnCount()+s;0===c.length?n.push(l):1===c.length?r[l]=c[0]:(i.push(l),o.push(c))}let a=new Array(o.length);for(let t=0;t<a.length;t++)a[t]=o[t];return mn.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),r,Le.toIntArray(n),Le.toIntArray(i),a)}static createDecoderResultFromAmbiguousValues(t,e,n,r,o){let i=new Int32Array(r.length),a=100;for(;a-- >0;){for(let t=0;t<i.length;t++)e[r[t]]=o[t][i[t]];try{return mn.decodeCodewords(e,t,n)}catch(t){if(!(t instanceof h))throw t}if(0===i.length)throw h.getChecksumInstance();for(let t=0;t<i.length;t++){if(i[t]<o[t].length-1){i[t]++;break}if(i[t]=0,t===i.length-1)throw h.getChecksumInstance()}}throw h.getChecksumInstance()}static createBarcodeMatrix(t){let e=Array.from({length:t.getBarcodeRowCount()},()=>new Array(t.getBarcodeColumnCount()+2));for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]=new Ye;let n=0;for(let r of t.getDetectionResultColumns()){if(null!=r)for(let t of r.getCodewords())if(null!=t){let r=t.getRowNumber();if(r>=0){if(r>=e.length)continue;e[r][n].setValue(t.getValue())}}n++}return e}static isValidBarcodeColumn(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1}static getStartColumn(t,e,n,r){let o=r?1:-1,i=null;if(mn.isValidBarcodeColumn(t,e-o)&&(i=t.getDetectionResultColumn(e-o).getCodeword(n)),null!=i)return r?i.getEndX():i.getStartX();if(i=t.getDetectionResultColumn(e).getCodewordNearby(n),null!=i)return r?i.getStartX():i.getEndX();if(mn.isValidBarcodeColumn(t,e-o)&&(i=t.getDetectionResultColumn(e-o).getCodewordNearby(n)),null!=i)return r?i.getEndX():i.getStartX();let a=0;for(;mn.isValidBarcodeColumn(t,e-o);){e-=o;for(let n of t.getDetectionResultColumn(e).getCodewords())if(null!=n)return(r?n.getEndX():n.getStartX())+o*a*(n.getEndX()-n.getStartX());a++}return r?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()}static detectCodeword(t,e,n,r,o,i,a,s){o=mn.adjustCodewordStartColumn(t,e,n,r,o,i);let c,l=mn.getModuleBitCount(t,e,n,r,o,i);if(null==l)return null;let d=ot.sum(l);if(r)c=o+d;else{for(let t=0;t<l.length/2;t++){let e=l[t];l[t]=l[l.length-1-t],l[l.length-1-t]=e}c=o,o=c-d}if(!mn.checkCodewordSkew(d,a,s))return null;let u=tn.getDecodedValue(l),h=Le.getCodeword(u);return-1===h?null:new Je(o,c,mn.getCodewordBucketNumber(u),h)}static getModuleBitCount(t,e,n,r,o,i){let a=o,s=new Int32Array(8),c=0,l=r?1:-1,d=r;for(;(r?a<n:a>=e)&&c<s.length;)t.get(a,i)===d?(s[c]++,a+=l):(c++,d=!d);return c===s.length||a===(r?n:e)&&c===s.length-1?s:null}static getNumberOfECCodeWords(t){return 2<<t}static adjustCodewordStartColumn(t,e,n,r,o,i){let a=o,s=r?-1:1;for(let c=0;c<2;c++){for(;(r?a>=e:a<n)&&r===t.get(a,i);){if(Math.abs(o-a)>mn.CODEWORD_SKEW_SIZE)return o;a+=s}s=-s,r=!r}return a}static checkCodewordSkew(t,e,n){return e-mn.CODEWORD_SKEW_SIZE<=t&&t<=n+mn.CODEWORD_SKEW_SIZE}static decodeCodewords(t,e,n){if(0===t.length)throw v.getFormatInstance();let r=1<<e+1,o=mn.correctErrors(t,n,r);mn.verifyCodewordCount(t,r);let i=hn.decode(t,""+e);return i.setErrorsCorrected(o),i.setErasures(n.length),i}static correctErrors(t,e,n){if(null!=e&&e.length>n/2+mn.MAX_ERRORS||n<0||n>mn.MAX_EC_CODEWORDS)throw h.getChecksumInstance();return mn.errorCorrection.decode(t,n,e)}static verifyCodewordCount(t,e){if(t.length<4)throw v.getFormatInstance();let n=t[0];if(n>t.length)throw v.getFormatInstance();if(0===n){if(!(e<t.length))throw v.getFormatInstance();t[0]=t.length-e}}static getBitCountForCodeword(t){let e=new Int32Array(8),n=0,r=e.length-1;for(;!((1&t)!==n&&(n=1&t,r--,r<0));)e[r]++,t>>=1;return e}static getCodewordBucketNumber(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)}static getCodewordBucketNumber_number(t){return mn.getCodewordBucketNumber(mn.getBitCountForCodeword(t))}static getCodewordBucketNumber_Int32Array(t){return(t[0]-t[2]+t[4]-t[6]+9)%9}static toString(t){let e=new Xe;for(let n=0;n<t.length;n++){e.format("Row %2d: ",n);for(let r=0;r<t[n].length;r++){let o=t[n][r];0===o.getValue().length?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}e.format("%n")}return e.toString()}}mn.CODEWORD_SKEW_SIZE=2,mn.MAX_ERRORS=3,mn.MAX_EC_CODEWORDS=512,mn.errorCorrection=new We;class fn{decode(t,e=null){let n=fn.decode(t,e,!1);if(null==n||0===n.length||null==n[0])throw T.getNotFoundInstance();return n[0]}decodeMultiple(t,e=null){try{return fn.decode(t,e,!0)}catch(t){if(t instanceof v||t instanceof h)throw T.getNotFoundInstance();throw t}}static decode(t,e,n){const r=new Array,o=Ve.detectMultiple(t,e,n);for(const t of o.getPoints()){const e=mn.decode(o.getBits(),t[4],t[5],t[6],t[7],fn.getMinCodewordWidth(t),fn.getMaxCodewordWidth(t)),n=new L(e.getText(),e.getRawBytes(),void 0,t,V.PDF_417);n.putMetadata(X.ERROR_CORRECTION_LEVEL,e.getECLevel());const i=e.getOther();null!=i&&n.putMetadata(X.PDF417_EXTRA_METADATA,i),r.push(n)}return r.map(t=>t)}static getMaxWidth(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMinWidth(t,e){return null==t||null==e?w.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMaxCodewordWidth(t){return Math.floor(Math.max(Math.max(fn.getMaxWidth(t[0],t[4]),fn.getMaxWidth(t[6],t[2])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN),Math.max(fn.getMaxWidth(t[1],t[5]),fn.getMaxWidth(t[7],t[3])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(t){return Math.floor(Math.min(Math.min(fn.getMinWidth(t[0],t[4]),fn.getMinWidth(t[6],t[2])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN),Math.min(fn.getMinWidth(t[1],t[5]),fn.getMinWidth(t[7],t[3])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN)))}reset(){}}class pn extends c{}pn.kind="ReaderException";class _n{constructor(t,e){this.verbose=!0===t,e&&this.setHints(e)}decode(t,e){return e&&this.setHints(e),this.decodeInternal(t)}decodeWithState(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)}setHints(t){this.hints=t;const n=!e(t)&&!0===t.get(b.TRY_HARDER),r=e(t)?null:t.get(b.POSSIBLE_FORMATS),o=new Array;if(!e(r)){const e=r.some(t=>t===V.UPC_A||t===V.UPC_E||t===V.EAN_13||t===V.EAN_8||t===V.CODABAR||t===V.CODE_39||t===V.CODE_93||t===V.CODE_128||t===V.ITF||t===V.RSS_14||t===V.RSS_EXPANDED);e&&!n&&o.push(new se(t,this.verbose)),r.includes(V.QR_CODE)&&o.push(new Fe),r.includes(V.DATA_MATRIX)&&o.push(new we),r.includes(V.AZTEC)&&o.push(new _t),r.includes(V.PDF_417)&&o.push(new fn),e&&n&&o.push(new se(t,this.verbose))}0===o.length&&(n||o.push(new se(t,this.verbose)),o.push(new Fe),o.push(new we),o.push(new _t),o.push(new fn),n&&o.push(new se(t,this.verbose))),this.readers=o}reset(){if(null!==this.readers)for(const t of this.readers)t.reset()}decodeInternal(t){if(null===this.readers)throw new pn("No readers where selected, nothing can be read.");for(const e of this.readers)try{return e.decode(t,this.hints)}catch(t){if(t instanceof pn)continue}throw new T("No MultiFormat Readers were able to detect the code.")}}class gn extends F{constructor(t=null,e=500){const n=new _n;n.setHints(t),super(n,e)}decodeBitmap(t){return this.reader.decodeWithState(t)}}class wn extends F{constructor(t=500){super(new fn,t)}}class $n extends F{constructor(t=500){super(new Fe,t)}}var yn;!function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(yn||(yn={}));var bn=yn;class vn{constructor(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Z(t,Int32Array.from([1])))}buildGenerator(t){const e=this.cachedGenerators;if(t>=e.length){let n=e[e.length-1];const r=this.field;for(let o=e.length;o<=t;o++){const t=n.multiply(new Z(r,Int32Array.from([1,r.exp(o-1+r.getGeneratorBase())])));e.push(t),n=t}}return e[t]}encode(t,e){if(0===e)throw new d("No error correction bytes");const n=t.length-e;if(n<=0)throw new d("No data bytes provided");const r=this.buildGenerator(e),o=new Int32Array(n);f.arraycopy(t,0,o,0,n);let i=new Z(this.field,o);i=i.multiplyByMonomial(e,1);const a=i.divide(r)[1].getCoefficients(),s=e-a.length;for(let e=0;e<s;e++)t[n+e]=0;f.arraycopy(a,0,t,n+s,a.length)}}class In{constructor(){}static applyMaskPenaltyRule1(t){return In.applyMaskPenaltyRule1Internal(t,!0)+In.applyMaskPenaltyRule1Internal(t,!1)}static applyMaskPenaltyRule2(t){let e=0;const n=t.getArray(),r=t.getWidth(),o=t.getHeight();for(let t=0;t<o-1;t++){const o=n[t];for(let i=0;i<r-1;i++){const r=o[i];r===o[i+1]&&r===n[t+1][i]&&r===n[t+1][i+1]&&e++}}return In.N2*e}static applyMaskPenaltyRule3(t){let e=0;const n=t.getArray(),r=t.getWidth(),o=t.getHeight();for(let t=0;t<o;t++)for(let i=0;i<r;i++){const a=n[t];i+6<r&&1===a[i]&&0===a[i+1]&&1===a[i+2]&&1===a[i+3]&&1===a[i+4]&&0===a[i+5]&&1===a[i+6]&&(In.isWhiteHorizontal(a,i-4,i)||In.isWhiteHorizontal(a,i+7,i+11))&&e++,t+6<o&&1===n[t][i]&&0===n[t+1][i]&&1===n[t+2][i]&&1===n[t+3][i]&&1===n[t+4][i]&&0===n[t+5][i]&&1===n[t+6][i]&&(In.isWhiteVertical(n,i,t-4,t)||In.isWhiteVertical(n,i,t+7,t+11))&&e++}return e*In.N3}static isWhiteHorizontal(t,e,n){e=Math.max(e,0),n=Math.min(n,t.length);for(let r=e;r<n;r++)if(1===t[r])return!1;return!0}static isWhiteVertical(t,e,n,r){n=Math.max(n,0),r=Math.min(r,t.length);for(let o=n;o<r;o++)if(1===t[o][e])return!1;return!0}static applyMaskPenaltyRule4(t){let e=0;const n=t.getArray(),r=t.getWidth(),o=t.getHeight();for(let t=0;t<o;t++){const o=n[t];for(let t=0;t<r;t++)1===o[t]&&e++}const i=t.getHeight()*t.getWidth();return Math.floor(10*Math.abs(2*e-i)/i)*In.N4}static getDataMaskBit(t,e,n){let r,o;switch(t){case 0:r=n+e&1;break;case 1:r=1&n;break;case 2:r=e%3;break;case 3:r=(n+e)%3;break;case 4:r=Math.floor(n/2)+Math.floor(e/3)&1;break;case 5:o=n*e,r=(1&o)+o%3;break;case 6:o=n*e,r=(1&o)+o%3&1;break;case 7:o=n*e,r=o%3+(n+e&1)&1;break;default:throw new d("Invalid mask pattern: "+t)}return 0===r}static applyMaskPenaltyRule1Internal(t,e){let n=0;const r=e?t.getHeight():t.getWidth(),o=e?t.getWidth():t.getHeight(),i=t.getArray();for(let t=0;t<r;t++){let r=0,a=-1;for(let s=0;s<o;s++){const o=e?i[t][s]:i[s][t];o===a?r++:(r>=5&&(n+=In.N1+(r-5)),r=1,a=o)}r>=5&&(n+=In.N1+(r-5))}return n}}In.N1=3,In.N2=3,In.N3=40,In.N4=10;class Cn{constructor(t,e){this.width=t,this.height=e;const n=new Array(e);for(let r=0;r!==e;r++)n[r]=new Uint8Array(t);this.bytes=n}getHeight(){return this.height}getWidth(){return this.width}get(t,e){return this.bytes[e][t]}getArray(){return this.bytes}setNumber(t,e,n){this.bytes[e][t]=n}setBoolean(t,e,n){this.bytes[e][t]=n?1:0}clear(t){for(const e of this.bytes)g.fill(e,t)}equals(t){if(!(t instanceof Cn))return!1;const e=t;if(this.width!==e.width)return!1;if(this.height!==e.height)return!1;for(let t=0,n=this.height;t<n;++t){const n=this.bytes[t],r=e.bytes[t];for(let t=0,e=this.width;t<e;++t)if(n[t]!==r[t])return!1}return!0}toString(){const t=new S;for(let e=0,n=this.height;e<n;++e){const n=this.bytes[e];for(let e=0,r=this.width;e<r;++e)switch(n[e]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append(" ")}t.append("\n")}return t.toString()}}class En{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const t=new S;return t.append("<<\n"),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append("\n ecLevel: "),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append("\n version: "),t.append(this.version?this.version.toString():"null"),t.append("\n maskPattern: "),t.append(this.maskPattern.toString()),this.matrix?(t.append("\n matrix:\n"),t.append(this.matrix.toString())):t.append("\n matrix: null\n"),t.append(">>\n"),t.toString()}setMode(t){this.mode=t}setECLevel(t){this.ecLevel=t}setVersion(t){this.version=t}setMaskPattern(t){this.maskPattern=t}setMatrix(t){this.matrix=t}static isValidMaskPattern(t){return t>=0&&t<En.NUM_MASK_PATTERNS}}En.NUM_MASK_PATTERNS=8;class An extends c{}An.kind="WriterException";class Sn{constructor(){}static clearMatrix(t){t.clear(255)}static buildMatrix(t,e,n,r,o){Sn.clearMatrix(o),Sn.embedBasicPatterns(n,o),Sn.embedTypeInfo(e,r,o),Sn.maybeEmbedVersionInfo(n,o),Sn.embedDataBits(t,r,o)}static embedBasicPatterns(t,e){Sn.embedPositionDetectionPatternsAndSeparators(e),Sn.embedDarkDotAtLeftBottomCorner(e),Sn.maybeEmbedPositionAdjustmentPatterns(t,e),Sn.embedTimingPatterns(e)}static embedTypeInfo(t,e,n){const r=new $;Sn.makeTypeInfoBits(t,e,r);for(let t=0,e=r.getSize();t<e;++t){const e=r.get(r.getSize()-1-t),o=Sn.TYPE_INFO_COORDINATES[t],i=o[0],a=o[1];if(n.setBoolean(i,a,e),t<8){const r=n.getWidth()-t-1,o=8;n.setBoolean(r,o,e)}else{const r=8,o=n.getHeight()-7+(t-8);n.setBoolean(r,o,e)}}}static maybeEmbedVersionInfo(t,e){if(t.getVersionNumber()<7)return;const n=new $;Sn.makeVersionInfoBits(t,n);let r=17;for(let t=0;t<6;++t)for(let o=0;o<3;++o){const i=n.get(r);r--,e.setBoolean(t,e.getHeight()-11+o,i),e.setBoolean(e.getHeight()-11+o,t,i)}}static embedDataBits(t,e,n){let r=0,o=-1,i=n.getWidth()-1,a=n.getHeight()-1;for(;i>0;){for(6===i&&(i-=1);a>=0&&a<n.getHeight();){for(let o=0;o<2;++o){const s=i-o;if(!Sn.isEmpty(n.get(s,a)))continue;let c;r<t.getSize()?(c=t.get(r),++r):c=!1,255!==e&&In.getDataMaskBit(e,s,a)&&(c=!c),n.setBoolean(s,a,c)}a+=o}o=-o,a+=o,i-=2}if(r!==t.getSize())throw new An("Not all bits consumed: "+r+"/"+t.getSize())}static findMSBSet(t){return 32-w.numberOfLeadingZeros(t)}static calculateBCHCode(t,e){if(0===e)throw new d("0 polynomial");const n=Sn.findMSBSet(e);for(t<<=n-1;Sn.findMSBSet(t)>=n;)t^=e<<Sn.findMSBSet(t)-n;return t}static makeTypeInfoBits(t,e,n){if(!En.isValidMaskPattern(e))throw new An("Invalid mask pattern");const r=t.getBits()<<3|e;n.appendBits(r,5);const o=Sn.calculateBCHCode(r,Sn.TYPE_INFO_POLY);n.appendBits(o,10);const i=new $;if(i.appendBits(Sn.TYPE_INFO_MASK_PATTERN,15),n.xor(i),15!==n.getSize())throw new An("should not happen but we got: "+n.getSize())}static makeVersionInfoBits(t,e){e.appendBits(t.getVersionNumber(),6);const n=Sn.calculateBCHCode(t.getVersionNumber(),Sn.VERSION_INFO_POLY);if(e.appendBits(n,12),18!==e.getSize())throw new An("should not happen but we got: "+e.getSize())}static isEmpty(t){return 255===t}static embedTimingPatterns(t){for(let e=8;e<t.getWidth()-8;++e){const n=(e+1)%2;Sn.isEmpty(t.get(e,6))&&t.setNumber(e,6,n),Sn.isEmpty(t.get(6,e))&&t.setNumber(6,e,n)}}static embedDarkDotAtLeftBottomCorner(t){if(0===t.get(8,t.getHeight()-8))throw new An;t.setNumber(8,t.getHeight()-8,1)}static embedHorizontalSeparationPattern(t,e,n){for(let r=0;r<8;++r){if(!Sn.isEmpty(n.get(t+r,e)))throw new An;n.setNumber(t+r,e,0)}}static embedVerticalSeparationPattern(t,e,n){for(let r=0;r<7;++r){if(!Sn.isEmpty(n.get(t,e+r)))throw new An;n.setNumber(t,e+r,0)}}static embedPositionAdjustmentPattern(t,e,n){for(let r=0;r<5;++r){const o=Sn.POSITION_ADJUSTMENT_PATTERN[r];for(let i=0;i<5;++i)n.setNumber(t+i,e+r,o[i])}}static embedPositionDetectionPattern(t,e,n){for(let r=0;r<7;++r){const o=Sn.POSITION_DETECTION_PATTERN[r];for(let i=0;i<7;++i)n.setNumber(t+i,e+r,o[i])}}static embedPositionDetectionPatternsAndSeparators(t){const e=Sn.POSITION_DETECTION_PATTERN[0].length;Sn.embedPositionDetectionPattern(0,0,t),Sn.embedPositionDetectionPattern(t.getWidth()-e,0,t),Sn.embedPositionDetectionPattern(0,t.getWidth()-e,t);const n=8;Sn.embedHorizontalSeparationPattern(0,n-1,t),Sn.embedHorizontalSeparationPattern(t.getWidth()-n,n-1,t),Sn.embedHorizontalSeparationPattern(0,t.getWidth()-n,t);const r=7;Sn.embedVerticalSeparationPattern(r,0,t),Sn.embedVerticalSeparationPattern(t.getHeight()-r-1,0,t),Sn.embedVerticalSeparationPattern(r,t.getHeight()-r,t)}static maybeEmbedPositionAdjustmentPatterns(t,e){if(t.getVersionNumber()<2)return;const n=t.getVersionNumber()-1,r=Sn.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(let t=0,n=r.length;t!==n;t++){const o=r[t];if(o>=0)for(let t=0;t!==n;t++){const n=r[t];n>=0&&Sn.isEmpty(e.get(n,o))&&Sn.embedPositionAdjustmentPattern(n-2,o-2,e)}}}}Sn.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Sn.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Sn.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Sn.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Sn.VERSION_INFO_POLY=7973,Sn.TYPE_INFO_POLY=1335,Sn.TYPE_INFO_MASK_PATTERN=21522;class kn{constructor(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Tn{constructor(){}static calculateMaskPenalty(t){return In.applyMaskPenaltyRule1(t)+In.applyMaskPenaltyRule2(t)+In.applyMaskPenaltyRule3(t)+In.applyMaskPenaltyRule4(t)}static encode(t,e,n=null){let r=Tn.DEFAULT_BYTE_MODE_ENCODING;const o=null!==n&&void 0!==n.get(bn.CHARACTER_SET);o&&(r=n.get(bn.CHARACTER_SET).toString());const i=this.chooseMode(t,r),a=new $;if(i===ke.BYTE&&(o||Tn.DEFAULT_BYTE_MODE_ENCODING!==r)){const t=I.getCharacterSetECIByName(r);void 0!==t&&this.appendECI(t,a)}this.appendModeInfo(i,a);const s=new $;let c;if(this.appendBytes(t,i,s,r),null!==n&&void 0!==n.get(bn.QR_VERSION)){const t=Number.parseInt(n.get(bn.QR_VERSION).toString(),10);c=Ce.getVersionForNumber(t);const r=this.calculateBitsNeeded(i,a,s,c);if(!this.willFit(r,c,e))throw new An("Data too big for requested version")}else c=this.recommendVersion(e,i,a,s);const l=new $;l.appendBitArray(a);const d=i===ke.BYTE?s.getSizeInBytes():t.length;this.appendLengthInfo(d,c,i,l),l.appendBitArray(s);const u=c.getECBlocksForLevel(e),h=c.getTotalCodewords()-u.getTotalECCodewords();this.terminateBits(h,l);const m=this.interleaveWithECBytes(l,c.getTotalCodewords(),h,u.getNumBlocks()),f=new En;f.setECLevel(e),f.setMode(i),f.setVersion(c);const p=c.getDimensionForVersion(),_=new Cn(p,p),g=this.chooseMaskPattern(m,e,c,_);return f.setMaskPattern(g),Sn.buildMatrix(m,e,c,g,_),f.setMatrix(_),f}static recommendVersion(t,e,n,r){const o=this.calculateBitsNeeded(e,n,r,Ce.getVersionForNumber(1)),i=this.chooseVersion(o,t),a=this.calculateBitsNeeded(e,n,r,i);return this.chooseVersion(a,t)}static calculateBitsNeeded(t,e,n,r){return e.getSize()+t.getCharacterCountBits(r)+n.getSize()}static getAlphanumericCode(t){return t<Tn.ALPHANUMERIC_TABLE.length?Tn.ALPHANUMERIC_TABLE[t]:-1}static chooseMode(t,e=null){if(I.SJIS.getName()===e&&this.isOnlyDoubleByteKanji(t))return ke.KANJI;let n=!1,r=!1;for(let e=0,o=t.length;e<o;++e){const o=t.charAt(e);if(Tn.isDigit(o))n=!0;else{if(-1===this.getAlphanumericCode(o.charCodeAt(0)))return ke.BYTE;r=!0}}return r?ke.ALPHANUMERIC:n?ke.NUMERIC:ke.BYTE}static isOnlyDoubleByteKanji(t){let e;try{e=E.encode(t,I.SJIS)}catch(t){return!1}const n=e.length;if(n%2!=0)return!1;for(let t=0;t<n;t+=2){const n=255&e[t];if((n<129||n>159)&&(n<224||n>235))return!1}return!0}static chooseMaskPattern(t,e,n,r){let o=Number.MAX_SAFE_INTEGER,i=-1;for(let a=0;a<En.NUM_MASK_PATTERNS;a++){Sn.buildMatrix(t,e,n,a,r);let s=this.calculateMaskPenalty(r);s<o&&(o=s,i=a)}return i}static chooseVersion(t,e){for(let n=1;n<=40;n++){const r=Ce.getVersionForNumber(n);if(Tn.willFit(t,r,e))return r}throw new An("Data too big")}static willFit(t,e,n){return e.getTotalCodewords()-e.getECBlocksForLevel(n).getTotalECCodewords()>=(t+7)/8}static terminateBits(t,e){const n=8*t;if(e.getSize()>n)throw new An("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(let t=0;t<4&&e.getSize()<n;++t)e.appendBit(!1);const r=7&e.getSize();if(r>0)for(let t=r;t<8;t++)e.appendBit(!1);const o=t-e.getSizeInBytes();for(let t=0;t<o;++t)e.appendBits(1&t?17:236,8);if(e.getSize()!==n)throw new An("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(t,e,n,r,o,i){if(r>=n)throw new An("Block ID too large");const a=t%n,s=n-a,c=Math.floor(t/n),l=c+1,d=Math.floor(e/n),u=d+1,h=c-d,m=l-u;if(h!==m)throw new An("EC bytes mismatch");if(n!==s+a)throw new An("RS blocks mismatch");if(t!==(d+h)*s+(u+m)*a)throw new An("Total bytes mismatch");r<s?(o[0]=d,i[0]=h):(o[0]=u,i[0]=m)}static interleaveWithECBytes(t,e,n,r){if(t.getSizeInBytes()!==n)throw new An("Number of bits and data bytes does not match");let o=0,i=0,a=0;const s=new Array;for(let c=0;c<r;++c){const l=new Int32Array(1),d=new Int32Array(1);Tn.getNumDataBytesAndNumECBytesForBlockID(e,n,r,c,l,d);const u=l[0],h=new Uint8Array(u);t.toBytes(8*o,h,0,u);const m=Tn.generateECBytes(h,d[0]);s.push(new kn(h,m)),i=Math.max(i,u),a=Math.max(a,m.length),o+=l[0]}if(n!==o)throw new An("Data bytes does not match offset");const c=new $;for(let t=0;t<i;++t)for(const e of s){const n=e.getDataBytes();t<n.length&&c.appendBits(n[t],8)}for(let t=0;t<a;++t)for(const e of s){const n=e.getErrorCorrectionBytes();t<n.length&&c.appendBits(n[t],8)}if(e!==c.getSizeInBytes())throw new An("Interleaving error: "+e+" and "+c.getSizeInBytes()+" differ.");return c}static generateECBytes(t,e){const n=t.length,r=new Int32Array(n+e);for(let e=0;e<n;e++)r[e]=255&t[e];new vn(J.QR_CODE_FIELD_256).encode(r,e);const o=new Uint8Array(e);for(let t=0;t<e;t++)o[t]=r[n+t];return o}static appendModeInfo(t,e){e.appendBits(t.getBits(),4)}static appendLengthInfo(t,e,n,r){const o=n.getCharacterCountBits(e);if(t>=1<<o)throw new An(t+" is bigger than "+((1<<o)-1));r.appendBits(t,o)}static appendBytes(t,e,n,r){switch(e){case ke.NUMERIC:Tn.appendNumericBytes(t,n);break;case ke.ALPHANUMERIC:Tn.appendAlphanumericBytes(t,n);break;case ke.BYTE:Tn.append8BitBytes(t,n,r);break;case ke.KANJI:Tn.appendKanjiBytes(t,n);break;default:throw new An("Invalid mode: "+e)}}static getDigit(t){return t.charCodeAt(0)-48}static isDigit(t){const e=Tn.getDigit(t);return e>=0&&e<=9}static appendNumericBytes(t,e){const n=t.length;let r=0;for(;r<n;){const o=Tn.getDigit(t.charAt(r));if(r+2<n){const n=Tn.getDigit(t.charAt(r+1)),i=Tn.getDigit(t.charAt(r+2));e.appendBits(100*o+10*n+i,10),r+=3}else if(r+1<n){const n=Tn.getDigit(t.charAt(r+1));e.appendBits(10*o+n,7),r+=2}else e.appendBits(o,4),r++}}static appendAlphanumericBytes(t,e){const n=t.length;let r=0;for(;r<n;){const o=Tn.getAlphanumericCode(t.charCodeAt(r));if(-1===o)throw new An;if(r+1<n){const n=Tn.getAlphanumericCode(t.charCodeAt(r+1));if(-1===n)throw new An;e.appendBits(45*o+n,11),r+=2}else e.appendBits(o,6),r++}}static append8BitBytes(t,e,n){let r;try{r=E.encode(t,n)}catch(t){throw new An(t)}for(let t=0,n=r.length;t!==n;t++){const n=r[t];e.appendBits(n,8)}}static appendKanjiBytes(t,e){let n;try{n=E.encode(t,I.SJIS)}catch(t){throw new An(t)}const r=n.length;for(let t=0;t<r;t+=2){const r=(255&n[t])<<8&4294967295|255&n[t+1];let o=-1;if(r>=33088&&r<=40956?o=r-33088:r>=57408&&r<=60351&&(o=r-49472),-1===o)throw new An("Invalid byte sequence");const i=192*(o>>8)+(255&o);e.appendBits(i,13)}}static appendECI(t,e){e.appendBits(ke.ECI.getBits(),4),e.appendBits(t.getValue(),8)}}Tn.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Tn.DEFAULT_BYTE_MODE_ENCODING=I.UTF8.getName();class Rn{write(t,e,n,r=null){if(0===t.length)throw new d("Found empty contents");if(e<0||n<0)throw new d("Requested dimensions are too small: "+e+"x"+n);let o=ye.L,i=Rn.QUIET_ZONE_SIZE;null!==r&&(void 0!==r.get(bn.ERROR_CORRECTION)&&(o=ye.fromString(r.get(bn.ERROR_CORRECTION).toString())),void 0!==r.get(bn.MARGIN)&&(i=Number.parseInt(r.get(bn.MARGIN).toString(),10)));const a=Tn.encode(t,o,r);return this.renderResult(a,e,n,i)}writeToDom(t,e,n,r,o=null){"string"==typeof t&&(t=document.querySelector(t));const i=this.write(e,n,r,o);t&&t.appendChild(i)}renderResult(t,e,n,r){const o=t.getMatrix();if(null===o)throw new et;const i=o.getWidth(),a=o.getHeight(),s=i+2*r,c=a+2*r,l=Math.max(e,s),d=Math.max(n,c),u=Math.min(Math.floor(l/s),Math.floor(d/c)),h=Math.floor((l-i*u)/2),m=Math.floor((d-a*u)/2),f=this.createSVGElement(l,d);for(let t=0,e=m;t<a;t++,e+=u)for(let n=0,r=h;n<i;n++,r+=u)if(1===o.get(n,t)){const t=this.createSvgRectElement(r,e,u,u);f.appendChild(t)}return f}createSVGElement(t,e){const n=document.createElementNS(Rn.SVG_NS,"svg");return n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString()),n}createSvgRectElement(t,e,n,r){const o=document.createElementNS(Rn.SVG_NS,"rect");return o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",e.toString()),o.setAttributeNS(null,"height",n.toString()),o.setAttributeNS(null,"width",r.toString()),o.setAttributeNS(null,"fill","#000000"),o}}Rn.QUIET_ZONE_SIZE=4,Rn.SVG_NS="http://www.w3.org/2000/svg";class Nn{encode(t,e,n,r,o){if(0===t.length)throw new d("Found empty contents");if(e!==V.QR_CODE)throw new d("Can only encode QR_CODE, but got "+e);if(n<0||r<0)throw new d(`Requested dimensions are too small: ${n}x${r}`);let i=ye.L,a=Nn.QUIET_ZONE_SIZE;null!==o&&(void 0!==o.get(bn.ERROR_CORRECTION)&&(i=ye.fromString(o.get(bn.ERROR_CORRECTION).toString())),void 0!==o.get(bn.MARGIN)&&(a=Number.parseInt(o.get(bn.MARGIN).toString(),10)));const s=Tn.encode(t,i,o);return Nn.renderResult(s,n,r,a)}static renderResult(t,e,n,r){const o=t.getMatrix();if(null===o)throw new et;const i=o.getWidth(),a=o.getHeight(),s=i+2*r,c=a+2*r,l=Math.max(e,s),d=Math.max(n,c),u=Math.min(Math.floor(l/s),Math.floor(d/c)),h=Math.floor((l-i*u)/2),m=Math.floor((d-a*u)/2),f=new k(l,d);for(let t=0,e=m;t<a;t++,e+=u)for(let n=0,r=h;n<i;n++,r+=u)1===o.get(n,t)&&f.setRegion(r,e,u,u);return f}}Nn.QUIET_ZONE_SIZE=4;class Dn{encode(t,e,n,r,o){let i;if(e!==V.QR_CODE)throw new d("No encoder available for format "+e);return i=new Nn,i.encode(t,e,n,r,o)}}class xn extends D{constructor(t,e,n,r,o,i,a,s){if(super(i,a),this.yuvData=t,this.dataWidth=e,this.dataHeight=n,this.left=r,this.top=o,r+i>e||o+a>n)throw new d("Crop rectangle does not fit within image data.");s&&this.reverseHorizontal(i,a)}getRow(t,e){if(t<0||t>=this.getHeight())throw new d("Requested row is outside the image: "+t);const n=this.getWidth();(null==e||e.length<n)&&(e=new Uint8ClampedArray(n));const r=(t+this.top)*this.dataWidth+this.left;return f.arraycopy(this.yuvData,r,e,0,n),e}getMatrix(){const t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.yuvData;const n=t*e,r=new Uint8ClampedArray(n);let o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return f.arraycopy(this.yuvData,o,r,0,n),r;for(let n=0;n<e;n++){const e=n*t;f.arraycopy(this.yuvData,o,r,e,t),o+=this.dataWidth}return r}isCropSupported(){return!0}crop(t,e,n,r){return new xn(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+e,n,r,!1)}renderThumbnail(){const t=this.getWidth()/xn.THUMBNAIL_SCALE_FACTOR,e=this.getHeight()/xn.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(t*e),r=this.yuvData;let o=this.top*this.dataWidth+this.left;for(let i=0;i<e;i++){const e=i*t;for(let i=0;i<t;i++){const t=255&r[o+i*xn.THUMBNAIL_SCALE_FACTOR];n[e+i]=4278190080|65793*t}o+=this.dataWidth*xn.THUMBNAIL_SCALE_FACTOR}return n}getThumbnailWidth(){return this.getWidth()/xn.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/xn.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(t,e){const n=this.yuvData;for(let r=0,o=this.top*this.dataWidth+this.left;r<e;r++,o+=this.dataWidth){const e=o+t/2;for(let r=o,i=o+t-1;r<e;r++,i--){const t=n[r];n[r]=n[i],n[i]=t}}}invert(){return new x(this)}}xn.THUMBNAIL_SCALE_FACTOR=2;class On extends D{constructor(t,e,n,r,o,i,a){if(super(e,n),this.dataWidth=r,this.dataHeight=o,this.left=i,this.top=a,4===t.BYTES_PER_ELEMENT){const r=e*n,o=new Uint8ClampedArray(r);for(let e=0;e<r;e++){const n=t[e],r=n>>16&255,i=n>>7&510,a=255&n;o[e]=(r+i+a)/4&255}this.luminances=o}else this.luminances=t;if(void 0===r&&(this.dataWidth=e),void 0===o&&(this.dataHeight=n),void 0===i&&(this.left=0),void 0===a&&(this.top=0),this.left+e>this.dataWidth||this.top+n>this.dataHeight)throw new d("Crop rectangle does not fit within image data.")}getRow(t,e){if(t<0||t>=this.getHeight())throw new d("Requested row is outside the image: "+t);const n=this.getWidth();(null==e||e.length<n)&&(e=new Uint8ClampedArray(n));const r=(t+this.top)*this.dataWidth+this.left;return f.arraycopy(this.luminances,r,e,0,n),e}getMatrix(){const t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.luminances;const n=t*e,r=new Uint8ClampedArray(n);let o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return f.arraycopy(this.luminances,o,r,0,n),r;for(let n=0;n<e;n++){const e=n*t;f.arraycopy(this.luminances,o,r,e,t),o+=this.dataWidth}return r}isCropSupported(){return!0}crop(t,e,n,r){return new On(this.luminances,n,r,this.dataWidth,this.dataHeight,this.left+t,this.top+e)}invert(){return new x(this)}}class Mn extends I{static forName(t){return this.getCharacterSetECIByName(t)}}class Pn{}Pn.ISO_8859_1=I.ISO8859_1;class Bn{isCompact(){return this.compact}setCompact(t){this.compact=t}getSize(){return this.size}setSize(t){this.size=t}getLayers(){return this.layers}setLayers(t){this.layers=t}getCodeWords(){return this.codeWords}setCodeWords(t){this.codeWords=t}getMatrix(){return this.matrix}setMatrix(t){this.matrix=t}}class Fn{static singletonList(t){return[t]}static min(t,e){return t.sort(e)[0]}}class Ln{constructor(t){this.previous=t}getPrevious(){return this.previous}}class qn extends Ln{constructor(t,e,n){super(t),this.value=e,this.bitCount=n}appendTo(t,e){t.appendBits(this.value,this.bitCount)}add(t,e){return new qn(this,t,e)}addBinaryShift(t,e){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new qn(this,t,e)}toString(){let t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+w.toBinaryString(t|1<<this.bitCount).substring(1)+">"}}class Vn extends qn{constructor(t,e,n){super(t,0,0),this.binaryShiftStart=e,this.binaryShiftByteCount=n}appendTo(t,e){for(let n=0;n<this.binaryShiftByteCount;n++)(0===n||31===n&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):0===n?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+n],8)}addBinaryShift(t,e){return new Vn(this,t,e)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function Hn(t,e,n){return new Vn(t,e,n)}function Un(t,e,n){return new qn(t,e,n)}const zn=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Wn=0,jn=1,Gn=2,Xn=3,Qn=4,Yn=new qn(null,0,0),Zn=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])];function Kn(t){for(let e of t)g.fill(e,-1);return t[Wn][Qn]=0,t[jn][Qn]=0,t[jn][Wn]=28,t[Xn][Qn]=0,t[Gn][Qn]=0,t[Gn][Wn]=15,t}const Jn=Kn(g.createInt32Array(6,6));class tr{constructor(t,e,n,r){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=r}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(t,e){let n=this.bitCount,r=this.token;if(t!==this.mode){let e=Zn[this.mode][t];r=Un(r,65535&e,e>>16),n+=e>>16}let o=t===Gn?4:5;return r=Un(r,e,o),new tr(r,t,0,n+o)}shiftAndAppend(t,e){let n=this.token,r=this.mode===Gn?4:5;return n=Un(n,Jn[this.mode][t],r),n=Un(n,e,5),new tr(n,this.mode,0,this.bitCount+r+5)}addBinaryShiftChar(t){let e=this.token,n=this.mode,r=this.bitCount;if(this.mode===Qn||this.mode===Gn){let t=Zn[n][Wn];e=Un(e,65535&t,t>>16),r+=t>>16,n=Wn}let o=0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8,i=new tr(e,n,this.binaryShiftByteCount+1,r+o);return 2078===i.binaryShiftByteCount&&(i=i.endBinaryShift(t+1)),i}endBinaryShift(t){if(0===this.binaryShiftByteCount)return this;let e=this.token;return e=Hn(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new tr(e,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(t){let e=this.bitCount+(Zn[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?e+=tr.calculateBinaryShiftCost(t)-tr.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount}toBitArray(t){let e=[];for(let n=this.endBinaryShift(t.length).token;null!==n;n=n.getPrevious())e.unshift(n);let n=new $;for(const r of e)r.appendTo(n,t);return n}toString(){return A.format("%s bits=%d bytes=%d",zn[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0}}function er(t){const e=A.getCharCode(" "),n=A.getCharCode("."),r=A.getCharCode(",");t[Wn][e]=1;const o=A.getCharCode("Z"),i=A.getCharCode("A");for(let e=i;e<=o;e++)t[Wn][e]=e-i+2;t[jn][e]=1;const a=A.getCharCode("z"),s=A.getCharCode("a");for(let e=s;e<=a;e++)t[jn][e]=e-s+2;t[Gn][e]=1;const c=A.getCharCode("9"),l=A.getCharCode("0");for(let e=l;e<=c;e++)t[Gn][e]=e-l+2;t[Gn][r]=12,t[Gn][n]=13;const d=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""];for(let e=0;e<d.length;e++)t[Xn][A.getCharCode(d[e])]=e;const u=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let e=0;e<u.length;e++)A.getCharCode(u[e])>0&&(t[Qn][A.getCharCode(u[e])]=e);return t}tr.INITIAL_STATE=new tr(Yn,Wn,0,0);const nr=er(g.createInt32Array(5,256));class rr{constructor(t){this.text=t}encode(){const t=A.getCharCode(" "),e=A.getCharCode("\n");let n=Fn.singletonList(tr.INITIAL_STATE);for(let r=0;r<this.text.length;r++){let o,i=r+1<this.text.length?this.text[r+1]:0;switch(this.text[r]){case A.getCharCode("\r"):o=i===e?2:0;break;case A.getCharCode("."):o=i===t?3:0;break;case A.getCharCode(","):o=i===t?4:0;break;case A.getCharCode(":"):o=i===t?5:0;break;default:o=0}o>0?(n=rr.updateStateListForPair(n,r,o),r++):n=this.updateStateListForChar(n,r)}return Fn.min(n,(t,e)=>t.getBitCount()-e.getBitCount()).toBitArray(this.text)}updateStateListForChar(t,e){const n=[];for(let r of t)this.updateStateForChar(r,e,n);return rr.simplifyStates(n)}updateStateForChar(t,e,n){let r=255&this.text[e],o=nr[t.getMode()][r]>0,i=null;for(let a=0;a<=Qn;a++){let s=nr[a][r];if(s>0){if(null==i&&(i=t.endBinaryShift(e)),!o||a===t.getMode()||a===Gn){const t=i.latchAndAppend(a,s);n.push(t)}if(!o&&Jn[t.getMode()][a]>=0){const t=i.shiftAndAppend(a,s);n.push(t)}}}if(t.getBinaryShiftByteCount()>0||0===nr[t.getMode()][r]){let r=t.addBinaryShiftChar(e);n.push(r)}}static updateStateListForPair(t,e,n){const r=[];for(let o of t)this.updateStateForPair(o,e,n,r);return this.simplifyStates(r)}static updateStateForPair(t,e,n,r){let o=t.endBinaryShift(e);if(r.push(o.latchAndAppend(Qn,n)),t.getMode()!==Qn&&r.push(o.shiftAndAppend(Qn,n)),3===n||4===n){let t=o.latchAndAppend(Gn,16-n).latchAndAppend(Gn,1);r.push(t)}if(t.getBinaryShiftByteCount()>0){let n=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);r.push(n)}}static simplifyStates(t){let e=[];for(const n of t){let t=!0;for(const r of e){if(r.isBetterThanOrEqualTo(n)){t=!1;break}n.isBetterThanOrEqualTo(r)&&(e=e.filter(t=>t!==r))}t&&e.push(n)}return e}}class or{constructor(){}static encodeBytes(t){return or.encode(t,or.DEFAULT_EC_PERCENT,or.DEFAULT_AZTEC_LAYERS)}static encode(t,e,n){let r,o,i,a,s,c=new rr(t).encode(),l=w.truncDivision(c.getSize()*e,100)+11,u=c.getSize()+l;if(n!==or.DEFAULT_AZTEC_LAYERS){if(r=n<0,o=Math.abs(n),o>(r?or.MAX_NB_BITS_COMPACT:or.MAX_NB_BITS))throw new d(A.format("Illegal value %s for layers",n));i=or.totalBitsInLayer(o,r),a=or.WORD_SIZE[o];let t=i-i%a;if(s=or.stuffBits(c,a),s.getSize()+l>t)throw new d("Data to large for user specified layer");if(r&&s.getSize()>64*a)throw new d("Data to large for user specified layer")}else{a=0,s=null;for(let t=0;;t++){if(t>or.MAX_NB_BITS)throw new d("Data too large for an Aztec code");if(r=t<=3,o=r?t+1:t,i=or.totalBitsInLayer(o,r),u>i)continue;null!=s&&a===or.WORD_SIZE[o]||(a=or.WORD_SIZE[o],s=or.stuffBits(c,a));let e=i-i%a;if(!(r&&s.getSize()>64*a)&&s.getSize()+l<=e)break}}let h,m=or.generateCheckWords(s,i,a),f=s.getSize()/a,p=or.generateModeMessage(r,o,f),_=(r?11:14)+4*o,g=new Int32Array(_);if(r){h=_;for(let t=0;t<g.length;t++)g[t]=t}else{h=_+1+2*w.truncDivision(w.truncDivision(_,2)-1,15);let t=w.truncDivision(_,2),e=w.truncDivision(h,2);for(let n=0;n<t;n++){let r=n+w.truncDivision(n,15);g[t-n-1]=e-r-1,g[t+n]=e+r+1}}let $=new k(h);for(let t=0,e=0;t<o;t++){let n=4*(o-t)+(r?9:12);for(let r=0;r<n;r++){let o=2*r;for(let i=0;i<2;i++)m.get(e+o+i)&&$.set(g[2*t+i],g[2*t+r]),m.get(e+2*n+o+i)&&$.set(g[2*t+r],g[_-1-2*t-i]),m.get(e+4*n+o+i)&&$.set(g[_-1-2*t-i],g[_-1-2*t-r]),m.get(e+6*n+o+i)&&$.set(g[_-1-2*t-r],g[2*t+i])}e+=8*n}if(or.drawModeMessage($,r,h,p),r)or.drawBullsEye($,w.truncDivision(h,2),5);else{or.drawBullsEye($,w.truncDivision(h,2),7);for(let t=0,e=0;t<w.truncDivision(_,2)-1;t+=15,e+=16)for(let t=1&w.truncDivision(h,2);t<h;t+=2)$.set(w.truncDivision(h,2)-e,t),$.set(w.truncDivision(h,2)+e,t),$.set(t,w.truncDivision(h,2)-e),$.set(t,w.truncDivision(h,2)+e)}let y=new Bn;return y.setCompact(r),y.setSize(h),y.setLayers(o),y.setCodeWords(f),y.setMatrix($),y}static drawBullsEye(t,e,n){for(let r=0;r<n;r+=2)for(let n=e-r;n<=e+r;n++)t.set(n,e-r),t.set(n,e+r),t.set(e-r,n),t.set(e+r,n);t.set(e-n,e-n),t.set(e-n+1,e-n),t.set(e-n,e-n+1),t.set(e+n,e-n),t.set(e+n,e-n+1),t.set(e+n,e+n-1)}static generateModeMessage(t,e,n){let r=new $;return t?(r.appendBits(e-1,2),r.appendBits(n-1,6),r=or.generateCheckWords(r,28,4)):(r.appendBits(e-1,5),r.appendBits(n-1,11),r=or.generateCheckWords(r,40,4)),r}static drawModeMessage(t,e,n,r){let o=w.truncDivision(n,2);if(e)for(let e=0;e<7;e++){let n=o-3+e;r.get(e)&&t.set(n,o-5),r.get(e+7)&&t.set(o+5,n),r.get(20-e)&&t.set(n,o+5),r.get(27-e)&&t.set(o-5,n)}else for(let e=0;e<10;e++){let n=o-5+e+w.truncDivision(e,5);r.get(e)&&t.set(n,o-7),r.get(e+10)&&t.set(o+7,n),r.get(29-e)&&t.set(n,o+7),r.get(39-e)&&t.set(o-7,n)}}static generateCheckWords(t,e,n){let r=t.getSize()/n,o=new vn(or.getGF(n)),i=w.truncDivision(e,n),a=or.bitsToWords(t,n,i);o.encode(a,i-r);let s=e%n,c=new $;c.appendBits(0,s);for(const t of Array.from(a))c.appendBits(t,n);return c}static bitsToWords(t,e,n){let r,o,i=new Int32Array(n);for(r=0,o=t.getSize()/e;r<o;r++){let n=0;for(let o=0;o<e;o++)n|=t.get(r*e+o)?1<<e-o-1:0;i[r]=n}return i}static getGF(t){switch(t){case 4:return J.AZTEC_PARAM;case 6:return J.AZTEC_DATA_6;case 8:return J.AZTEC_DATA_8;case 10:return J.AZTEC_DATA_10;case 12:return J.AZTEC_DATA_12;default:throw new d("Unsupported word size "+t)}}static stuffBits(t,e){let n=new $,r=t.getSize(),o=(1<<e)-2;for(let i=0;i<r;i+=e){let a=0;for(let n=0;n<e;n++)(i+n>=r||t.get(i+n))&&(a|=1<<e-1-n);(a&o)===o?(n.appendBits(a&o,e),i--):0===(a&o)?(n.appendBits(1|a,e),i--):n.appendBits(a,e)}return n}static totalBitsInLayer(t,e){return((e?88:112)+16*t)*t}}or.DEFAULT_EC_PERCENT=33,or.DEFAULT_AZTEC_LAYERS=0,or.MAX_NB_BITS=32,or.MAX_NB_BITS_COMPACT=4,or.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class ir{encode(t,e,n,r){return this.encodeWithHints(t,e,n,r,null)}encodeWithHints(t,e,n,r,o){let i=Pn.ISO_8859_1,a=or.DEFAULT_EC_PERCENT,s=or.DEFAULT_AZTEC_LAYERS;return null!=o&&(o.has(bn.CHARACTER_SET)&&(i=Mn.forName(o.get(bn.CHARACTER_SET).toString())),o.has(bn.ERROR_CORRECTION)&&(a=w.parseInt(o.get(bn.ERROR_CORRECTION).toString())),o.has(bn.AZTEC_LAYERS)&&(s=w.parseInt(o.get(bn.AZTEC_LAYERS).toString()))),ir.encodeLayers(t,e,n,r,i,a,s)}static encodeLayers(t,e,n,r,o,i,a){if(e!==V.AZTEC)throw new d("Can only encode AZTEC, but got "+e);let s=or.encode(A.getBytes(t,o),i,a);return ir.renderResult(s,n,r)}static renderResult(t,e,n){let r=t.getMatrix();if(null==r)throw new et;let o=r.getWidth(),i=r.getHeight(),a=Math.max(e,o),s=Math.max(n,i),c=Math.min(a/o,s/i),l=(a-o*c)/2,d=(s-i*c)/2,u=new k(a,s);for(let t=0,e=d;t<i;t++,e+=c)for(let n=0,i=l;n<o;n++,i+=c)r.get(n,t)&&u.setRegion(i,e,c,c);return u}}t.AbstractExpandedDecoder=zt,t.ArgumentException=l,t.ArithmeticException=K,t.AztecCode=Bn,t.AztecCodeReader=_t,t.AztecCodeWriter=ir,t.AztecDecoder=rt,t.AztecDetector=pt,t.AztecDetectorResult=ct,t.AztecEncoder=or,t.AztecHighLevelEncoder=rr,t.AztecPoint=ft,t.BarcodeFormat=V,t.Binarizer=m,t.BinaryBitmap=u,t.BitArray=$,t.BitMatrix=k,t.BitSource=fe,t.BrowserAztecCodeReader=gt,t.BrowserBarcodeReader=ce,t.BrowserCodeReader=F,t.BrowserDatamatrixCodeReader=$e,t.BrowserMultiFormatReader=gn,t.BrowserPDF417Reader=wn,t.BrowserQRCodeReader=$n,t.BrowserQRCodeSvgWriter=Rn,t.CharacterSetECI=I,t.ChecksumException=h,t.Code128Reader=$t,t.Code39Reader=yt,t.DataMatrixDecodedBitStreamParser=pe,t.DataMatrixReader=we,t.DecodeHintType=b,t.DecoderResult=Q,t.DefaultGridSampler=ht,t.DetectorResult=st,t.EAN13Reader=St,t.EncodeHintType=bn,t.Exception=c,t.FormatException=v,t.GenericGF=J,t.GenericGFPoly=Z,t.GlobalHistogramBinarizer=R,t.GridSampler=dt,t.GridSamplerInstance=mt,t.HTMLCanvasElementLuminanceSource=O,t.HybridBinarizer=N,t.ITFReader=bt,t.IllegalArgumentException=d,t.IllegalStateException=et,t.InvertedLuminanceSource=x,t.LuminanceSource=D,t.MathUtils=ot,t.MultiFormatOneDReader=se,t.MultiFormatReader=_n,t.MultiFormatWriter=Dn,t.NotFoundException=T,t.OneDReader=wt,t.PDF417DecodedBitStreamParser=hn,t.PDF417DecoderErrorCorrection=We,t.PDF417Reader=fn,t.PDF417ResultMetadata=en,t.PerspectiveTransform=ut,t.PlanarYUVLuminanceSource=xn,t.QRCodeByteMatrix=Cn,t.QRCodeDataMask=Ee,t.QRCodeDecodedBitStreamParser=Te,t.QRCodeDecoderErrorCorrectionLevel=ye,t.QRCodeDecoderFormatInformation=be,t.QRCodeEncoder=Tn,t.QRCodeEncoderQRCode=En,t.QRCodeMaskUtil=In,t.QRCodeMatrixUtil=Sn,t.QRCodeMode=ke,t.QRCodeReader=Fe,t.QRCodeVersion=Ce,t.QRCodeWriter=Nn,t.RGBLuminanceSource=On,t.RSS14Reader=ae,t.RSSExpandedReader=oe,t.ReaderException=pn,t.ReedSolomonDecoder=nt,t.ReedSolomonEncoder=vn,t.ReedSolomonException=tt,t.Result=L,t.ResultMetadataType=X,t.ResultPoint=at,t.StringUtils=A,t.UnsupportedOperationException=C,t.VideoInputDevice=M,t.WhiteRectangleDetector=lt,t.WriterException=An,t.ZXingArrays=g,t.ZXingCharset=Mn,t.ZXingInteger=w,t.ZXingStandardCharsets=Pn,t.ZXingStringBuilder=S,t.ZXingStringEncoding=E,t.ZXingSystem=f,t.createAbstractExpandedDecoder=ee,Object.defineProperty(t,"__esModule",{value:!0})}(e)}),zxingJs_umd$1=getDefaultExportFromCjs(zxingJs_umd),ZXing=_mergeNamespaces({__proto__:null,default:zxingJs_umd$1},[zxingJs_umd]),ZXingHtml5QrcodeDecoder=function(){function t(t,e,n){if(this.formatMap=new Map([[Html5QrcodeSupportedFormats.QR_CODE,zxingJs_umd.BarcodeFormat.QR_CODE],[Html5QrcodeSupportedFormats.AZTEC,zxingJs_umd.BarcodeFormat.AZTEC],[Html5QrcodeSupportedFormats.CODABAR,zxingJs_umd.BarcodeFormat.CODABAR],[Html5QrcodeSupportedFormats.CODE_39,zxingJs_umd.BarcodeFormat.CODE_39],[Html5QrcodeSupportedFormats.CODE_93,zxingJs_umd.BarcodeFormat.CODE_93],[Html5QrcodeSupportedFormats.CODE_128,zxingJs_umd.BarcodeFormat.CODE_128],[Html5QrcodeSupportedFormats.DATA_MATRIX,zxingJs_umd.BarcodeFormat.DATA_MATRIX],[Html5QrcodeSupportedFormats.MAXICODE,zxingJs_umd.BarcodeFormat.MAXICODE],[Html5QrcodeSupportedFormats.ITF,zxingJs_umd.BarcodeFormat.ITF],[Html5QrcodeSupportedFormats.EAN_13,zxingJs_umd.BarcodeFormat.EAN_13],[Html5QrcodeSupportedFormats.EAN_8,zxingJs_umd.BarcodeFormat.EAN_8],[Html5QrcodeSupportedFormats.PDF_417,zxingJs_umd.BarcodeFormat.PDF_417],[Html5QrcodeSupportedFormats.RSS_14,zxingJs_umd.BarcodeFormat.RSS_14],[Html5QrcodeSupportedFormats.RSS_EXPANDED,zxingJs_umd.BarcodeFormat.RSS_EXPANDED],[Html5QrcodeSupportedFormats.UPC_A,zxingJs_umd.BarcodeFormat.UPC_A],[Html5QrcodeSupportedFormats.UPC_E,zxingJs_umd.BarcodeFormat.UPC_E],[Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION,zxingJs_umd.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!ZXing)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=e,this.logger=n;var r=this.createZXingFormats(t),o=new Map;o.set(zxingJs_umd.DecodeHintType.POSSIBLE_FORMATS,r),o.set(zxingJs_umd.DecodeHintType.TRY_HARDER,!1),this.hints=o}return t.prototype.decodeAsync=function(t){var e=this;return new Promise(function(n,r){try{n(e.decode(t))}catch(t){r(t)}})},t.prototype.decode=function(t){var e=new zxingJs_umd.MultiFormatReader(this.verbose,this.hints),n=new zxingJs_umd.HTMLCanvasElementLuminanceSource(t),r=new zxingJs_umd.BinaryBitmap(new zxingJs_umd.HybridBinarizer(n)),o=e.decode(r);return{text:o.text,format:QrcodeResultFormat.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}},t.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(e,n,r){t.set(e,n)}),t},t.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},t.prototype.createZXingFormats=function(t){for(var e=[],n=0,r=t;n<r.length;n++){var o=r[n];this.formatMap.has(o)?e.push(this.formatMap.get(o)):this.logger.logError("".concat(o," is not supported by")+"ZXingHtml5QrcodeShim")}return e},t.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},t}(),__awaiter$4=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$4=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},BarcodeDetectorDelegate=function(){function t(e,n,r){if(this.formatMap=new Map([[Html5QrcodeSupportedFormats.QR_CODE,"qr_code"],[Html5QrcodeSupportedFormats.AZTEC,"aztec"],[Html5QrcodeSupportedFormats.CODABAR,"codabar"],[Html5QrcodeSupportedFormats.CODE_39,"code_39"],[Html5QrcodeSupportedFormats.CODE_93,"code_93"],[Html5QrcodeSupportedFormats.CODE_128,"code_128"],[Html5QrcodeSupportedFormats.DATA_MATRIX,"data_matrix"],[Html5QrcodeSupportedFormats.ITF,"itf"],[Html5QrcodeSupportedFormats.EAN_13,"ean_13"],[Html5QrcodeSupportedFormats.EAN_8,"ean_8"],[Html5QrcodeSupportedFormats.PDF_417,"pdf417"],[Html5QrcodeSupportedFormats.UPC_A,"upc_a"],[Html5QrcodeSupportedFormats.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!t.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var o=this.createBarcodeDetectorFormats(e);if(this.detector=new BarcodeDetector(o),!this.detector)throw"BarcodeDetector detector not supported"}return t.isSupported=function(){return"BarcodeDetector"in window&&void 0!==new BarcodeDetector({formats:["qr_code"]})},t.prototype.decodeAsync=function(t){return __awaiter$4(this,void 0,void 0,function(){var e,n;return __generator$4(this,function(r){switch(r.label){case 0:return[4,this.detector.detect(t)];case 1:if(!(e=r.sent())||0===e.length)throw"No barcode or QR code detected.";return[2,{text:(n=this.selectLargestBarcode(e)).rawValue,format:QrcodeResultFormat.create(this.toHtml5QrcodeSupportedFormats(n.format)),debugData:this.createDebugData()}]}})})},t.prototype.selectLargestBarcode=function(t){for(var e=null,n=0,r=0,o=t;r<o.length;r++){var i=o[r],a=i.boundingBox.width*i.boundingBox.height;a>n&&(n=a,e=i)}if(!e)throw"No largest barcode found";return e},t.prototype.createBarcodeDetectorFormats=function(t){for(var e=[],n=0,r=t;n<r.length;n++){var o=r[n];this.formatMap.has(o)?e.push(this.formatMap.get(o)):this.logger.warn("".concat(o," is not supported by")+"BarcodeDetectorDelegate")}return{formats:e}},t.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},t.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(e,n,r){t.set(e,n)}),t},t.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},t}(),__awaiter$3=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$3=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Html5QrcodeShim=function(){function t(t,e,n,r){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=n,e&&BarcodeDetectorDelegate.isSupported()?(this.primaryDecoder=new BarcodeDetectorDelegate(t,n,r),this.secondaryDecoder=new ZXingHtml5QrcodeDecoder(t,n,r)):this.primaryDecoder=new ZXingHtml5QrcodeDecoder(t,n,r)}return t.prototype.decodeAsync=function(t){return __awaiter$3(this,void 0,void 0,function(){var e;return __generator$3(this,function(n){switch(n.label){case 0:e=performance.now(),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,n.sent()];case 3:return this.possiblyLogPerformance(e),[7];case 4:return[2]}})})},t.prototype.decodeRobustlyAsync=function(t){return __awaiter$3(this,void 0,void 0,function(){var e,n;return __generator$3(this,function(r){switch(r.label){case 0:e=performance.now(),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,r.sent()];case 3:if(n=r.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw n;case 4:return this.possiblyLogPerformance(e),[7];case 5:return[2]}})})},t.prototype.getDecoder=function(){return this.secondaryDecoder?!1===this.wasPrimaryDecoderUsedInLastDecode?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},t.prototype.possiblyLogPerformance=function(t){if(this.verbose){var e=performance.now()-t;this.executionResults.push(e),this.executions++,this.possiblyFlushPerformanceReport()}},t.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,e=0,n=this.executionResults;e<n.length;e++){t+=n[e]}var r=t/this.executionResults.length;console.log("".concat(r," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},t}(),__extends$1=(extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},extendStatics(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__awaiter$2=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$2=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},AbstractCameraCapability=function(){function t(t,e){this.name=t,this.track=e}return t.prototype.isSupported=function(){return!!this.track.getCapabilities&&this.name in this.track.getCapabilities()},t.prototype.apply=function(t){var e={};e[this.name]=t;var n={advanced:[e]};return this.track.applyConstraints(n)},t.prototype.value=function(){var t=this.track.getSettings();return this.name in t?t[this.name]:null},t}(),AbstractRangeCameraCapability=function(t){function e(e,n){return t.call(this,e,n)||this}return __extends$1(e,t),e.prototype.min=function(){return this.getCapabilities().min},e.prototype.max=function(){return this.getCapabilities().max},e.prototype.step=function(){return this.getCapabilities().step},e.prototype.apply=function(t){var e={};e[this.name]=t;var n={advanced:[e]};return this.track.applyConstraints(n)},e.prototype.getCapabilities=function(){this.failIfNotSupported();var t=this.track.getCapabilities()[this.name];return{min:t.min,max:t.max,step:t.step}},e.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},e}(AbstractCameraCapability),ZoomFeatureImpl=function(t){function e(e){return t.call(this,"zoom",e)||this}return __extends$1(e,t),e}(AbstractRangeCameraCapability),TorchFeatureImpl=function(t){function e(e){return t.call(this,"torch",e)||this}return __extends$1(e,t),e}(AbstractCameraCapability),CameraCapabilitiesImpl=function(){function t(t){this.track=t}return t.prototype.zoomFeature=function(){return new ZoomFeatureImpl(this.track)},t.prototype.torchFeature=function(){return new TorchFeatureImpl(this.track)},t}(),RenderedCameraImpl=function(){function t(t,e,n){this.isClosed=!1,this.parentElement=t,this.mediaStream=e,this.callbacks=n,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return t.prototype.createVideoElement=function(t){var e=document.createElement("video");return e.style.width="".concat(t,"px"),e.style.display="block",e.muted=!0,e.setAttribute("muted","true"),e.playsInline=!0,e},t.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var e=function(){var n=t.surface.clientWidth,r=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(n,r),t.surface.removeEventListener("playing",e)};this.surface.addEventListener("playing",e),this.surface.srcObject=this.mediaStream,this.surface.play()},t.create=function(e,n,r,o){return __awaiter$2(this,void 0,void 0,function(){var i,a;return __generator$2(this,function(s){switch(s.label){case 0:return i=new t(e,n,o),r.aspectRatio?(a={aspectRatio:r.aspectRatio},[4,i.getFirstTrackOrFail().applyConstraints(a)]):[3,2];case 1:s.sent(),s.label=2;case 2:return i.setupSurface(),[2,i]}})})},t.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},t.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),0===this.mediaStream.getVideoTracks().length)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},t.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},t.prototype.resume=function(t){this.failIfClosed();var e=this,n=function(){setTimeout(t,200),e.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.play()},t.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},t.prototype.getSurface=function(){return this.failIfClosed(),this.surface},t.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},t.prototype.applyVideoConstraints=function(t){return __awaiter$2(this,void 0,void 0,function(){return __generator$2(this,function(e){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},t.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(e,n){var r=t.mediaStream.getVideoTracks().length,o=0;t.mediaStream.getVideoTracks().forEach(function(n){t.mediaStream.removeTrack(n),n.stop(),++o>=r&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),e())})})},t.prototype.getCapabilities=function(){return new CameraCapabilitiesImpl(this.getFirstTrackOrFail())},t}(),CameraImpl=function(){function t(t){this.mediaStream=t}return t.prototype.render=function(t,e,n){return __awaiter$2(this,void 0,void 0,function(){return __generator$2(this,function(r){return[2,RenderedCameraImpl.create(t,this.mediaStream,e,n)]})})},t.create=function(e){return __awaiter$2(this,void 0,void 0,function(){var n;return __generator$2(this,function(r){switch(r.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:e},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return[2,new t(r.sent())]}})})},t}(),__awaiter$1=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$1=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},CameraFactory=function(){function t(){}return t.failIfNotSupported=function(){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function(e){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new t]})})},t.prototype.create=function(t){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function(e){return[2,CameraImpl.create(t)]})})},t}(),__awaiter=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},CameraRetriever=function(){function t(){}return t.retrieve=function(){if(navigator.mediaDevices)return t.getCamerasFromMediaDevices();var e=MediaStreamTrack;return MediaStreamTrack&&e.getSources?t.getCamerasFromMediaStreamTrack():t.rejectWithError()},t.rejectWithError=function(){var e=Html5QrcodeStrings.unableToQuerySupportedDevices();return t.isHttpsOrLocalhost()||(e=Html5QrcodeStrings.insecureContextCameraQueryError()),Promise.reject(e)},t.isHttpsOrLocalhost=function(){if("https:"===location.protocol)return!0;var t=location.host.split(":")[0];return"127.0.0.1"===t||"localhost"===t},t.getCamerasFromMediaDevices=function(){return __awaiter(this,void 0,void 0,function(){var t,e,n,r,o,i,a;return __generator(this,function(s){switch(s.label){case 0:return t=function(t){for(var e=0,n=t.getVideoTracks();e<n.length;e++){var r=n[e];r.enabled=!1,r.stop(),t.removeTrack(r)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return e=s.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(n=s.sent(),r=[],o=0,i=n;o<i.length;o++)"videoinput"===(a=i[o]).kind&&r.push({id:a.deviceId,label:a.label});return t(e),[2,r]}})})},t.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,e){MediaStreamTrack.getSources(function(e){for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r];"video"===i.kind&&n.push({id:i.id,label:i.label})}t(n)})})},t}(),Html5QrcodeScannerState;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.SCANNING=2]="SCANNING",t[t.PAUSED=3]="PAUSED"}(Html5QrcodeScannerState||(Html5QrcodeScannerState={}));var StateManagerImpl=function(){function t(){this.state=Html5QrcodeScannerState.NOT_STARTED,this.onGoingTransactionNewState=Html5QrcodeScannerState.UNKNOWN}return t.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},t.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},t.prototype.execute=function(){if(this.onGoingTransactionNewState===Html5QrcodeScannerState.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Html5QrcodeScannerState.UNKNOWN,this.directTransition(t)},t.prototype.cancel=function(){if(this.onGoingTransactionNewState===Html5QrcodeScannerState.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Html5QrcodeScannerState.UNKNOWN},t.prototype.getState=function(){return this.state},t.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Html5QrcodeScannerState.UNKNOWN)throw"Cannot transition to a new state, already under transition"},t.prototype.validateTransition=function(t){switch(this.state){case Html5QrcodeScannerState.UNKNOWN:throw"Transition from unknown is not allowed";case Html5QrcodeScannerState.NOT_STARTED:this.failIfNewStateIs(t,[Html5QrcodeScannerState.PAUSED]);case Html5QrcodeScannerState.SCANNING:case Html5QrcodeScannerState.PAUSED:}},t.prototype.failIfNewStateIs=function(t,e){for(var n=0,r=e;n<r.length;n++){if(t===r[n])throw"Cannot transition from ".concat(this.state," to ").concat(t)}},t}(),StateManagerProxy=function(){function t(t){this.stateManager=t}return t.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},t.prototype.directTransition=function(t){this.stateManager.directTransition(t)},t.prototype.getState=function(){return this.stateManager.getState()},t.prototype.canScanFile=function(){return this.stateManager.getState()===Html5QrcodeScannerState.NOT_STARTED},t.prototype.isScanning=function(){return this.stateManager.getState()!==Html5QrcodeScannerState.NOT_STARTED},t.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Html5QrcodeScannerState.SCANNING},t.prototype.isPaused=function(){return this.stateManager.getState()===Html5QrcodeScannerState.PAUSED},t}(),StateManagerFactory=function(){function t(){}return t.create=function(){return new StateManagerProxy(new StateManagerImpl)},t}(),__extends=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Constants=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.DEFAULT_WIDTH=300,e.DEFAULT_WIDTH_OFFSET=2,e.FILE_SCAN_MIN_HEIGHT=300,e.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,e.MIN_QR_BOX_SIZE=50,e.SHADED_LEFT=1,e.SHADED_RIGHT=2,e.SHADED_TOP=3,e.SHADED_BOTTOM=4,e.SHADED_REGION_ELEMENT_ID="qr-shaded-region",e.VERBOSE=!1,e.BORDER_SHADER_DEFAULT_COLOR="#ffffff",e.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",e}(Html5QrcodeConstants),InternalHtml5QrcodeConfig=function(){function t(t,e){this.logger=e,this.fps=Constants.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=!0===t.disableFlip,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=Constants.DEFAULT_DISABLE_FLIP}return t.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?VideoConstraintsUtil.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},t.prototype.isShadedBoxEnabled=function(){return!isNullOrUndefined(this.qrbox)},t.create=function(e,n){return new t(e,n)},t}(),Html5Qrcode=function(){function t(t,e){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");var n;this.elementId=t,this.verbose=!1,"boolean"==typeof e?this.verbose=!0===e:e&&(n=e,this.verbose=!0===n.verbose,n.experimentalFeatures),this.logger=new BaseLoggger(this.verbose),this.qrcode=new Html5QrcodeShim(this.getSupportedFormats(e),this.getUseBarCodeDetectorIfSupported(n),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=StateManagerFactory.create()}return t.prototype.start=function(t,e,n,r){var o,i=this;if(!t)throw"cameraIdOrConfig is required";if(!n||"function"!=typeof n)throw"qrCodeSuccessCallback is required and should be a function.";o=r||(this.verbose?this.logger.log:function(){});var a=InternalHtml5QrcodeConfig.create(e,this.logger);this.clearElement();var s=!1;a.videoConstraints&&(a.isMediaStreamConstraintsValid()?s=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var c=s,l=document.getElementById(this.elementId);l.clientWidth?l.clientWidth:Constants.DEFAULT_WIDTH,l.style.position="relative",this.shouldScan=!0,this.element=l;var d=this,u=this.stateManagerProxy.startTransition(Html5QrcodeScannerState.SCANNING);return new Promise(function(e,r){var s=c?a.videoConstraints:d.createVideoConstraints(t);if(!s)return u.cancel(),void r("videoConstraints should be defined");var l={};c&&!a.aspectRatio||(l.aspectRatio=a.aspectRatio);var h={onRenderSurfaceReady:function(t,e){d.setupUi(t,e,a),d.isScanning=!0,d.foreverScan(a,n,o)}};CameraFactory.failIfNotSupported().then(function(t){t.create(s).then(function(t){return t.render(i.element,l,h).then(function(t){d.renderedCamera=t,u.execute(),e(null)}).catch(function(t){u.cancel(),r(t)})}).catch(function(t){u.cancel(),r(Html5QrcodeStrings.errorGettingUserMedia(t))})}).catch(function(t){u.cancel(),r(Html5QrcodeStrings.cameraStreamingNotSupported())})})},t.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Html5QrcodeScannerState.PAUSED),this.showPausedState(),(isNullOrUndefined(t)||!0!==t)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},t.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,e=function(){t.stateManagerProxy.directTransition(Html5QrcodeScannerState.SCANNING),t.hidePausedState()};this.renderedCamera.isPaused()?this.renderedCamera.resume(function(){e()}):e()},t.prototype.getState=function(){return this.stateManagerProxy.getState()},t.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var e=this.stateManagerProxy.startTransition(Html5QrcodeScannerState.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var n=this;return this.renderedCamera.close().then(function(){return n.renderedCamera=null,n.element&&(n.element.removeChild(n.canvasElement),n.canvasElement=null),function(){if(t.element){var e=document.getElementById(Constants.SHADED_REGION_ELEMENT_ID);e&&t.element.removeChild(e)}}(),n.qrRegion&&(n.qrRegion=null),n.context&&(n.context=null),e.execute(),n.hidePausedState(),n.isScanning=!1,Promise.resolve()})},t.prototype.scanFile=function(t,e){return this.scanFileV2(t,e).then(function(t){return t.decodedText})},t.prototype.scanFileV2=function(t,e){var n=this;if(!(t&&t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(isNullOrUndefined(e)&&(e=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(r,o){n.possiblyCloseLastScanImageFile(),n.clearElement(),n.lastScanImageFile=URL.createObjectURL(t);var i=new Image;i.onload=function(){var t=i.width,a=i.height,s=document.getElementById(n.elementId),c=s.clientWidth?s.clientWidth:Constants.DEFAULT_WIDTH,l=Math.max(s.clientHeight?s.clientHeight:a,Constants.FILE_SCAN_MIN_HEIGHT),d=n.computeCanvasDrawConfig(t,a,c,l);if(e){var u=n.createCanvasElement(c,l,"qr-canvas-visible");u.style.display="inline-block",s.appendChild(u);var h=u.getContext("2d");if(!h)throw"Unable to get 2d context from canvas";h.canvas.width=c,h.canvas.height=l,h.drawImage(i,0,0,t,a,d.x,d.y,d.width,d.height)}var m=Constants.FILE_SCAN_HIDDEN_CANVAS_PADDING,f=Math.max(i.width,d.width),p=Math.max(i.height,d.height),_=f+2*m,g=p+2*m,w=n.createCanvasElement(_,g);s.appendChild(w);var $=w.getContext("2d");if(!$)throw"Unable to get 2d context from canvas";$.canvas.width=_,$.canvas.height=g,$.drawImage(i,0,0,t,a,m,m,f,p);try{n.qrcode.decodeRobustlyAsync(w).then(function(t){r(Html5QrcodeResultFactory.createFromQrcodeResult(t))}).catch(o)}catch(t){o("QR code parse error, error = ".concat(t))}},i.onerror=o,i.onabort=o,i.onstalled=o,i.onsuspend=o,i.src=URL.createObjectURL(t)})},t.prototype.clear=function(){this.clearElement()},t.getCameras=function(){return CameraRetriever.retrieve()},t.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},t.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},t.prototype.applyVideoConstraints=function(t){if(!t)throw"videoConstaints is required argument.";if(!VideoConstraintsUtil.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},t.prototype.getRenderedCameraOrFail=function(){if(null==this.renderedCamera)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},t.prototype.getSupportedFormats=function(t){var e=[Html5QrcodeSupportedFormats.QR_CODE,Html5QrcodeSupportedFormats.AZTEC,Html5QrcodeSupportedFormats.CODABAR,Html5QrcodeSupportedFormats.CODE_39,Html5QrcodeSupportedFormats.CODE_93,Html5QrcodeSupportedFormats.CODE_128,Html5QrcodeSupportedFormats.DATA_MATRIX,Html5QrcodeSupportedFormats.MAXICODE,Html5QrcodeSupportedFormats.ITF,Html5QrcodeSupportedFormats.EAN_13,Html5QrcodeSupportedFormats.EAN_8,Html5QrcodeSupportedFormats.PDF_417,Html5QrcodeSupportedFormats.RSS_14,Html5QrcodeSupportedFormats.RSS_EXPANDED,Html5QrcodeSupportedFormats.UPC_A,Html5QrcodeSupportedFormats.UPC_E,Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION];if(!t||"boolean"==typeof t)return e;if(!t.formatsToSupport)return e;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(0===t.formatsToSupport.length)throw"Atleast 1 formatsToSupport is needed.";for(var n=[],r=0,o=t.formatsToSupport;r<o.length;r++){var i=o[r];isValidHtml5QrcodeSupportedFormats(i)?n.push(i):this.logger.warn("Invalid format: ".concat(i," passed in config, ignoring."))}if(0===n.length)throw"None of formatsToSupport match supported values.";return n},t.prototype.getUseBarCodeDetectorIfSupported=function(t){if(isNullOrUndefined(t))return!0;if(!isNullOrUndefined(t.useBarCodeDetectorIfSupported))return!1!==t.useBarCodeDetectorIfSupported;if(isNullOrUndefined(t.experimentalFeatures))return!0;var e=t.experimentalFeatures;return!!isNullOrUndefined(e.useBarCodeDetectorIfSupported)||!1!==e.useBarCodeDetectorIfSupported},t.prototype.validateQrboxSize=function(t,e,n){var r=this,o=n.qrbox;this.validateQrboxConfig(o);var i,a=this.toQrdimensions(t,e,o),s=function(t){if(t<Constants.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(Constants.MIN_QR_BOX_SIZE,"px.")};s(a.width),s(a.height),a.width=((i=a.width)>t&&(r.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),i=t),i)},t.prototype.validateQrboxConfig=function(t){if("number"!=typeof t&&"function"!=typeof t&&(void 0===t.width||void 0===t.height))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},t.prototype.toQrdimensions=function(t,e,n){if("number"==typeof n)return{width:n,height:n};if("function"==typeof n)try{return n(t,e)}catch(t){throw new Error("qrbox config was passed as a function but it failed with unknown error"+t)}return n},t.prototype.setupUi=function(t,e,n){n.isShadedBoxEnabled()&&this.validateQrboxSize(t,e,n);var r=isNullOrUndefined(n.qrbox)?{width:t,height:e}:n.qrbox;this.validateQrboxConfig(r);var o=this.toQrdimensions(t,e,r);o.height>e&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var i=n.isShadedBoxEnabled()&&o.height<=e,a={x:0,y:0,width:t,height:e},s=i?this.getShadedRegionBounds(t,e,o):a,c=this.createCanvasElement(s.width,s.height),l=c.getContext("2d",{willReadFrequently:!0});l.canvas.width=s.width,l.canvas.height=s.height,this.element.append(c),i&&this.possiblyInsertShadingElement(this.element,t,e,o),this.createScannerPausedUiElement(this.element),this.qrRegion=s,this.context=l,this.canvasElement=c},t.prototype.createScannerPausedUiElement=function(t){var e=document.createElement("div");e.innerText=Html5QrcodeStrings.scannerPaused(),e.style.display="none",e.style.position="absolute",e.style.top="0px",e.style.zIndex="1",e.style.background="rgba(9, 9, 9, 0.46)",e.style.color="#FFECEC",e.style.textAlign="center",e.style.width="100%",t.appendChild(e),this.scannerPausedUiElement=e},t.prototype.scanContext=function(t,e){var n=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(e){return t(e.text,Html5QrcodeResultFactory.createFromQrcodeResult(e)),n.possiblyUpdateShaders(!0),!0}).catch(function(t){n.possiblyUpdateShaders(!1);var r=Html5QrcodeStrings.codeParseError(t);return e(r,Html5QrcodeErrorFactory.createFrom(r)),!1})},t.prototype.foreverScan=function(t,e,n){var r=this;if(this.shouldScan&&this.renderedCamera){var o=this.renderedCamera.getSurface(),i=o.videoWidth/o.clientWidth,a=o.videoHeight/o.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var s=this.qrRegion.width*i,c=this.qrRegion.height*a,l=this.qrRegion.x*i,d=this.qrRegion.y*a;this.context.drawImage(o,l,d,s,c,0,0,this.qrRegion.width,this.qrRegion.height);var u=function(){r.foreverScanTimeout=setTimeout(function(){r.foreverScan(t,e,n)},r.getTimeoutFps(t.fps))};this.scanContext(e,n).then(function(o){o||!0===t.disableFlip?u():(r.context.translate(r.context.canvas.width,0),r.context.scale(-1,1),r.scanContext(e,n).finally(function(){u()}))}).catch(function(t){r.logger.logError("Error happend while scanning context",t),u()})}},t.prototype.createVideoConstraints=function(t){if("string"==typeof t)return{deviceId:{exact:t}};if("object"==typeof t){var e="facingMode",n="deviceId",r={user:!0,environment:!0},o="exact",i=function(t){if(t in r)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(t,"'")},a=Object.keys(t);if(1!==a.length)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(a.length," keys");var s=Object.keys(t)[0];if(s!==e&&s!==n)throw"Only '".concat(e,"' and '").concat(n,"' ")+" are supported for 'cameraIdOrConfig'";if(s!==e){var c=t.deviceId;if("string"==typeof c)return{deviceId:c};if("object"==typeof c){if(o in c)return{deviceId:{exact:c["".concat(o)]}};throw"'deviceId' should be string or object with"+" ".concat(o," as key.")}throw"Invalid type of 'deviceId' = ".concat(typeof c)}var l=t.facingMode;if("string"==typeof l){if(i(l))return{facingMode:l}}else{if("object"!=typeof l)throw"Invalid type of 'facingMode' = ".concat(typeof l);if(!(o in l))throw"'facingMode' should be string or object with"+" ".concat(o," as key.");if(i(l["".concat(o)]))return{facingMode:{exact:l["".concat(o)]}}}}throw"Invalid type of 'cameraIdOrConfig' = ".concat(typeof t)},t.prototype.computeCanvasDrawConfig=function(t,e,n,r){if(t<=n&&e<=r)return{x:(n-t)/2,y:(r-e)/2,width:t,height:e};var o=t,i=e;return t>n&&(e*=n/t,t=n),e>r&&(t*=r/e,e=r),this.logger.log("Image downsampled from "+"".concat(o,"X").concat(i)+" to ".concat(t,"X").concat(e,".")),this.computeCanvasDrawConfig(t,e,n,r)},t.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},t.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(e){e.style.backgroundColor=t?Constants.BORDER_SHADER_MATCH_COLOR:Constants.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},t.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},t.prototype.createCanvasElement=function(t,e,n){var r=t,o=e,i=document.createElement("canvas");return i.style.width="".concat(r,"px"),i.style.height="".concat(o,"px"),i.style.display="none",i.id=isNullOrUndefined(n)?"qr-canvas":n,i},t.prototype.getShadedRegionBounds=function(t,e,n){if(n.width>t||n.height>e)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-n.width)/2,y:(e-n.height)/2,width:n.width,height:n.height}},t.prototype.possiblyInsertShadingElement=function(t,e,n,r){if(!(e-r.width<1||n-r.height<1)){var o=document.createElement("div");o.style.position="absolute";var i=(e-r.width)/2,a=(n-r.height)/2;if(o.style.borderLeft="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderRight="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderTop="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderBottom="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.boxSizing="border-box",o.style.top="0px",o.style.bottom="0px",o.style.left="0px",o.style.right="0px",o.id="".concat(Constants.SHADED_REGION_ELEMENT_ID),e-r.width<11||n-r.height<11)this.hasBorderShaders=!1;else{var s=40;this.insertShaderBorders(o,s,5,-5,null,0,!0),this.insertShaderBorders(o,s,5,-5,null,0,!1),this.insertShaderBorders(o,s,5,null,-5,0,!0),this.insertShaderBorders(o,s,5,null,-5,0,!1),this.insertShaderBorders(o,5,45,-5,null,-5,!0),this.insertShaderBorders(o,5,45,null,-5,-5,!0),this.insertShaderBorders(o,5,45,-5,null,-5,!1),this.insertShaderBorders(o,5,45,null,-5,-5,!1),this.hasBorderShaders=!0}t.append(o)}},t.prototype.insertShaderBorders=function(t,e,n,r,o,i,a){var s=document.createElement("div");s.style.position="absolute",s.style.backgroundColor=Constants.BORDER_SHADER_DEFAULT_COLOR,s.style.width="".concat(e,"px"),s.style.height="".concat(n,"px"),null!==r&&(s.style.top="".concat(r,"px")),null!==o&&(s.style.bottom="".concat(o,"px")),a?s.style.left="".concat(i,"px"):s.style.right="".concat(i,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(s),t.appendChild(s)},t.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},t.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},t.prototype.getTimeoutFps=function(t){return 1e3/t},t}(),Html5QrcodeScannerStatus;function add_css$2(){var t=element("style");t.id="svelte-9062r9-style",t.textContent="main.svelte-9062r9{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;max-height:400px}reader.svelte-9062r9{width:400px;height:300px;background-color:gray}",append(document.head,t)}function get_each_context$2(t,e,n){const r=t.slice();return r[19]=e[n].id,r[20]=e[n].label,r}function create_if_block$2(t){let e,n,r=t[1]&&create_if_block_1$2(t);return{c(){r&&r.c(),e=space(),n=element("reader"),attr(n,"id","reader"),attr(n,"class","svelte-9062r9")},m(t,o){r&&r.m(t,o),insert(t,e,o),insert(t,n,o)},p(t,n){t[1]?r?r.p(t,n):(r=create_if_block_1$2(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){r&&r.d(t),t&&detach(e),t&&detach(n)}}}function create_if_block_1$2(t){let e,n,r,o,i,a,s=t[1],c=[];for(let e=0;e<s.length;e+=1)c[e]=create_each_block$2(get_each_context$2(t,s,e));return{c(){e=element("div"),n=text("Quelle:\n "),r=element("select");for(let t=0;t<c.length;t+=1)c[t].c();r.disabled=o=1===t[1].length},m(o,s){insert(o,e,s),append(e,n),append(e,r);for(let t=0;t<c.length;t+=1)c[t].m(r,null);i||(a=listen(r,"change",t[4]),i=!0)},p(t,e){if(6&e){let n;for(s=t[1],n=0;n<s.length;n+=1){const o=get_each_context$2(t,s,n);c[n]?c[n].p(o,e):(c[n]=create_each_block$2(o),c[n].c(),c[n].m(r,null))}for(;n<c.length;n+=1)c[n].d(1);c.length=s.length}2&e&&o!==(o=1===t[1].length)&&(r.disabled=o)},d(t){t&&detach(e),destroy_each(c,t),i=!1,a()}}}function create_each_block$2(t){let e,n,r,o,i=t[20]+"";return{c(){e=element("option"),n=text(i),e.__value=r=t[19],e.value=e.__value,e.selected=o=t[2]===t[19]},m(t,r){insert(t,e,r),append(e,n)},p(t,a){2&a&&i!==(i=t[20]+"")&&set_data(n,i),2&a&&r!==(r=t[19])&&(e.__value=r,e.value=e.__value),6&a&&o!==(o=t[2]===t[19])&&(e.selected=o)},d(t){t&&detach(e)}}}function create_fragment$3(t){let e,n=!t[0]&&create_if_block$2(t);return{c(){e=element("main"),n&&n.c(),attr(e,"class","svelte-9062r9")},m(t,r){insert(t,e,r),n&&n.m(e,null)},p(t,[r]){t[0]?n&&(n.d(1),n=null):n?n.p(t,r):(n=create_if_block$2(t),n.c(),n.m(e,null))},i:noop,o:noop,d(t){t&&detach(e),n&&n.d()}}}!function(t){t[t.STATUS_DEFAULT=0]="STATUS_DEFAULT",t[t.STATUS_SUCCESS=1]="STATUS_SUCCESS",t[t.STATUS_WARNING=2]="STATUS_WARNING",t[t.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"}(Html5QrcodeScannerStatus||(Html5QrcodeScannerStatus={}));const getCameras$1=()=>Html5Qrcode.getCameras();function instance$3(t,e,n){let r;const o=createEventDispatcher(),{loggedIn:i}=user;component_subscribe(t,i,t=>n(9,r=t));let a,s,c,{keyboard:l}=e,{codeTypes:d=""}=e,{readerInit:u=!1}=e,h=!1;const m=r.tenant+"-ENABLERR-CAMERA";onMount(function(){if(l)return void(h=!0);try{a||(a=new Html5Qrcode("reader"));const t=window.localStorage.getItem(m);getCameras$1().then(e=>{if(!e?.length)return;n(1,s=e);const r=e.find(e=>e.id===t);r&&window.localStorage.setItem(m,r.id),p(r?.id||s[0].id)})}catch{}}),onDestroy(function(){_(),o("exit")});var f=function(t,e){var n=250,r=t>e?e:t,o=Math.floor(.75*r);return o<n?r<n?{width:r,height:r}:{width:n,height:n}:{width:o,height:o}};function p(t){if(t&&n(2,c=t),c)try{a.start(c,{fps:5,qrbox:f,formatsToSupport:d||void 0,facingMode:"environment"},g),h=!0}catch{}}async function _(t=!1){try{l||(await a.stop(),t&&await a.clear())}catch{}finally{h=!1}}function g(t,e){h&&(o("scan",{text:t}),h=!1)}return t.$$set=t=>{"keyboard"in t&&n(0,l=t.keyboard),"codeTypes"in t&&n(6,d=t.codeTypes),"readerInit"in t&&n(5,u=t.readerInit)},t.$$.update=()=>{32&t.$$.dirty&&u&&(h=!0,n(5,u=!1))},[l,s,c,i,async t=>{const e=t.target.value;await _(),window.localStorage.setItem(m,e),p(e)},u,d]}class InputReader extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-9062r9-style")||add_css$2(),init(this,t,instance$3,create_fragment$3,safe_not_equal,{keyboard:0,codeTypes:6,readerInit:5})}}const{document:document_1$1}=globals;function add_css$1(){var t=element("style");t.id="svelte-9vv5ub-style",t.textContent=".accordion.svelte-9vv5ub{display:flex;overflow:hidden}.accordion-content.svelte-9vv5ub{position:relative}.formList .accordion > .btn{display:inline-block;margin-bottom:1em;background-color:#F5F5F5}.sTask .formList .accordion > .btn{width:95% !important}.sEmbedded .formList .accordion > .btn{width:97%}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-9vv5ub{padding-top:1em}div.delete.svelte-9vv5ub{text-decoration:line-through}.icon.svelte-9vv5ub{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-9vv5ub{cursor:drag}.draggableListItem.is-active-top.svelte-9vv5ub{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-9vv5ub{border-bottom:3px purple solid;padding-bottom:2em}.modal-overlay > .dialog.reader{margin-top:0}",append(document_1$1.head,t)}function get_each_context$1(t,e,n){const r=t.slice();return r[143]=e[n],r[145]=n,r}function get_each_context_1$1(t,e,n){const r=t.slice();return r[147]=e[n],r[149]=n,r}function get_each_context_3(t,e,n){const r=t.slice();return r[156]=e[n],r}function get_each_context_2$1(t,e,n){const r=t.slice();return r[151]=e[n].title,r[152]=e[n].toDelete,r[153]=e[n].icon,r}function create_catch_block$1(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$1(t){let e,n,r,o,i,a,s,c,l,d,u,h=(!t[2]||t[15]?.length&&t[15].length>1)&&create_if_block_14$1(t),m=t[19]&&create_if_block_13$1(t),f=!1!==t[4].transfer&&t[49]?.length&&create_if_block_12$1(t),p=!t[10]&&t[45]&&t[14]&&0!=t[14]&&create_if_block_11$1(t),_=!t[10]&&t[43]&&t[17]&&0!=t[17]&&create_if_block_10$1(t),g=t[41]&&t[13]&&0!=t[13]&&create_if_block_9$1(t);c=new t[36]({props:{class:t[6]+t[4].name,$$slots:{default:[create_default_slot_4$1,({closeOtherPanels:t})=>({146:t}),({closeOtherPanels:t})=>[0,0,0,0,t?4194304:0]]},$$scope:{ctx:t}}});let w=t[19]&&t[22]&&create_if_block$1(t);return{c(){h&&h.c(),e=space(),n=element("div"),m&&m.c(),r=space(),f&&f.c(),o=space(),p&&p.c(),i=space(),_&&_.c(),a=space(),g&&g.c(),s=space(),create_component(c.$$.fragment),l=space(),w&&w.c(),d=empty(),attr(n,"class","formList")},m(t,$){h&&h.m(t,$),insert(t,e,$),insert(t,n,$),m&&m.m(n,null),append(n,r),f&&f.m(n,null),append(n,o),p&&p.m(n,null),append(n,i),_&&_.m(n,null),append(n,a),g&&g.m(n,null),append(n,s),mount_component(c,n,null),insert(t,l,$),w&&w.m(t,$),insert(t,d,$),u=!0},p(t,l){!t[2]||t[15]?.length&&t[15].length>1?h?(h.p(t,l),32772&l[0]&&transition_in(h,1)):(h=create_if_block_14$1(t),h.c(),transition_in(h,1),h.m(e.parentNode,e)):h&&(group_outros(),transition_out(h,1,1,()=>{h=null}),check_outros()),t[19]?m?(m.p(t,l),524288&l[0]&&transition_in(m,1)):(m=create_if_block_13$1(t),m.c(),transition_in(m,1),m.m(n,r)):m&&(group_outros(),transition_out(m,1,1,()=>{m=null}),check_outros()),!1!==t[4].transfer&&t[49]?.length?f?(f.p(t,l),16&l[0]&&transition_in(f,1)):(f=create_if_block_12$1(t),f.c(),transition_in(f,1),f.m(n,o)):f&&(group_outros(),transition_out(f,1,1,()=>{f=null}),check_outros()),!t[10]&&t[45]&&t[14]&&0!=t[14]?p?(p.p(t,l),17408&l[0]&&transition_in(p,1)):(p=create_if_block_11$1(t),p.c(),transition_in(p,1),p.m(n,i)):p&&(group_outros(),transition_out(p,1,1,()=>{p=null}),check_outros()),!t[10]&&t[43]&&t[17]&&0!=t[17]?_?(_.p(t,l),132096&l[0]&&transition_in(_,1)):(_=create_if_block_10$1(t),_.c(),transition_in(_,1),_.m(n,a)):_&&(group_outros(),transition_out(_,1,1,()=>{_=null}),check_outros()),t[41]&&t[13]&&0!=t[13]?g?(g.p(t,l),8192&l[0]&&transition_in(g,1)):(g=create_if_block_9$1(t),g.c(),transition_in(g,1),g.m(n,s)):g&&(group_outros(),transition_out(g,1,1,()=>{g=null}),check_outros());const u={};80&l[0]&&(u.class=t[6]+t[4].name),1612554239&l[0]|1&l[1]|4194304&l[4]|16&l[5]&&(u.$$scope={dirty:l,ctx:t}),c.$set(u),t[19]&&t[22]?w?(w.p(t,l),4718592&l[0]&&transition_in(w,1)):(w=create_if_block$1(t),w.c(),transition_in(w,1),w.m(d.parentNode,d)):w&&(group_outros(),transition_out(w,1,1,()=>{w=null}),check_outros())},i(t){u||(transition_in(h),transition_in(m),transition_in(f),transition_in(p),transition_in(_),transition_in(g),transition_in(c.$$.fragment,t),transition_in(w),u=!0)},o(t){transition_out(h),transition_out(m),transition_out(f),transition_out(p),transition_out(_),transition_out(g),transition_out(c.$$.fragment,t),transition_out(w),u=!1},d(t){h&&h.d(t),t&&detach(e),t&&detach(n),m&&m.d(),f&&f.d(),p&&p.d(),_&&_.d(),g&&g.d(),destroy_component(c),t&&detach(l),w&&w.d(t),t&&detach(d)}}}function create_if_block_14$1(t){let e,n;return e=new t[38]({props:{text:t[4].designation}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16&n[0]&&(r.text=t[4].designation),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_13$1(t){let e,n;return e=new t[35]({props:{disabled:t[1]||!t[0]._id&&t[21].input,filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_11$1]},$$scope:{ctx:t}}}),e.$on("click",t[70]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2097155&n[0]&&(r.disabled=t[1]||!t[0]._id&&t[21].input),16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_11$1(t){let e,n,r;return n=new CameraIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Barcode scannen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_12$1(t){let e,n;return e=new t[35]({props:{filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_10$1]},$$scope:{ctx:t}}}),e.$on("click",t[77]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_10$1(t){let e,n,r,o,i=t[69](t[4].transfer)+"";return r=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),n=text(i),create_component(r.$$.fragment),set_style(e,"margin-right",".75em")},m(t,i){insert(t,e,i),append(e,n),mount_component(r,t,i),o=!0},p(t,e){(!o||16&e[0])&&i!==(i=t[69](t[4].transfer)+"")&&set_data(n,i)},i(t){o||(transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(r.$$.fragment,t),o=!1},d(t){t&&detach(e),destroy_component(r,t)}}}function create_if_block_11$1(t){let e,n;return e=new t[34]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[create_default_slot_9$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16384&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_9$1(t){let e,n,r;function o(e){t[83](e)}let i={item:t[46],disabled:!0};return void 0!==t[14]&&(i.value=t[14]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};!n&&16384&r[0]&&(n=!0,o.value=t[14],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_10$1(t){let e,n;return e=new t[34]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[create_default_slot_8$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};131072&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_8$1(t){let e,n,r;function o(e){t[84](e)}let i={item:t[44],disabled:!0};return void 0!==t[17]&&(i.value=t[17]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};!n&&131072&r[0]&&(n=!0,o.value=t[17],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_9$1(t){let e,n;return e=new t[34]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[create_default_slot_7$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8448&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_7$1(t){let e,n,r;function o(e){t[85](e)}let i={item:t[42],disabled:!0,currency:t[8]};return void 0!==t[13]&&(i.value=t[13]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};256&r[0]&&(o.currency=t[8]),!n&&8192&r[0]&&(n=!0,o.value=t[13],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_6$1(t){let e,n;return e=new t[37]({props:{class:t[29][t[149]],open:t[12]&&!t[2]&&0===t[149]&&!t[19],$$slots:{handle:[create_handle_slot,({toggle:t,open:e})=>({150:t,12:e}),({toggle:t,open:e})=>[e?4096:0,0,0,0,t?67108864:0]],default:[create_default_slot_6$1,({toggle:t,open:e})=>({150:t,12:e}),({toggle:t,open:e})=>[e?4096:0,0,0,0,t?67108864:0]]},$$scope:{ctx:t}}}),e.$on("panel-open",function(){is_function(t[66](t[149],t[146]))&&t[66](t[149],t[146]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};536870912&r[0]&&(o.class=t[29][t[149]]),528388&r[0]&&(o.open=t[12]&&!t[2]&&0===t[149]&&!t[19]),1075159035&r[0]|1&r[1]|67108864&r[4]|16&r[5]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_3(t){let e,n;return e=new InputFormField({props:{praefix:t[149],item:t[156],eventId:t[7],fullRecord:t[0],record:t[147],recordId:t[0]._id,multiValues:t[5],reqQuantity:t[3],notifyList:t[9],noForm:noForm,classId:t[6],disabled:t[1],required:t[40],selectionFields:t[50],propSelection:t[20],numberInput:t[31],dateInput:{...t[11],l:t[4].name,t:t[149]===t[15].length-1,n:t[48].get(t[156].name)},shortEdit:t[10],currency:t[8],initFinished:t[18],formnovalidate:t[149]===t[15].length-1||t[15][t[149]]._delete}}),e.$on("notify",function(){is_function(t[54](t[4],t[156],t[149]))&&t[54](t[4],t[156],t[149]).apply(this,arguments)}),e.$on("task",function(){is_function(t[53](t[4]))&&t[53](t[4]).apply(this,arguments)}),e.$on("invalid",t[55]),e.$on("defPrep",t[56]),e.$on("checkRange",t[57]),e.$on("formula",t[67](t[149])),e.$on("record",t[86]),e.$on("listRecord",t[58](t[149])),e.$on("propSelection",t[68](t[149])),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};16&r[0]&&(o.item=t[156]),128&r[0]&&(o.eventId=t[7]),1&r[0]&&(o.fullRecord=t[0]),32768&r[0]&&(o.record=t[147]),1&r[0]&&(o.recordId=t[0]._id),32&r[0]&&(o.multiValues=t[5]),8&r[0]&&(o.reqQuantity=t[3]),512&r[0]&&(o.notifyList=t[9]),64&r[0]&&(o.classId=t[6]),2&r[0]&&(o.disabled=t[1]),1048576&r[0]&&(o.propSelection=t[20]),1&r[1]&&(o.numberInput=t[31]),34832&r[0]&&(o.dateInput={...t[11],l:t[4].name,t:t[149]===t[15].length-1,n:t[48].get(t[156].name)}),1024&r[0]&&(o.shortEdit=t[10]),256&r[0]&&(o.currency=t[8]),262144&r[0]&&(o.initFinished=t[18]),32768&r[0]&&(o.formnovalidate=t[149]===t[15].length-1||t[15][t[149]]._delete),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_key_block_1(t){let e,n,r=t[4].item,o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_3(get_each_context_3(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(1347579&n[0]|264897025&n[1]|96&n[2]){let a;for(r=t[4].item,a=0;a<r.length;a+=1){const i=get_each_context_3(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block_3(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_key_block(t){let e,n,r=t[15][t[149]]._delete,o=create_key_block_1(t);return{c(){o.c(),e=empty()},m(t,r){o.m(t,r),insert(t,e,r),n=!0},p(t,n){32768&n[0]&&safe_not_equal(r,r=t[15][t[149]]._delete)?(group_outros(),transition_out(o,1,1,noop),check_outros(),o=create_key_block_1(t),o.c(),transition_in(o),o.m(e.parentNode,e)):o.p(t,n)},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){t&&detach(e),o.d(t)}}}function create_default_slot_6$1(t){let e,n,r,o,i=t[15].length,a=create_key_block(t);return{c(){e=element("div"),a.c(),r=space(),attr(e,"id",n=`accordion-content-${t[6]}-${t[4].name}-${t[149]}`)},m(t,n){insert(t,e,n),a.m(e,null),insert(t,r,n),o=!0},p(t,r){32768&r[0]&&safe_not_equal(i,i=t[15].length)?(group_outros(),transition_out(a,1,1,noop),check_outros(),a=create_key_block(t),a.c(),transition_in(a),a.m(e,null)):a.p(t,r),(!o||80&r[0]&&n!==(n=`accordion-content-${t[6]}-${t[4].name}-${t[149]}`))&&attr(e,"id",n)},i(t){o||(transition_in(a),o=!0)},o(t){transition_out(a),o=!1},d(t){t&&detach(e),a.d(t),t&&detach(r)}}}function create_if_block_8$1(t){let e,n;return e=new t[35]({props:{$$slots:{default:[create_default_slot_5$1]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[59](t[150],t[149],t[12]))&&t[59](t[150],t[149],t[12]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};1073840144&r[0]|16&r[5]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_5$1(t){let e,n,r,o,i,a=t[52](t[16],t[149])+"";return{c(){e=element("div"),n=text(a),attr(e,"class",r=null_to_empty("draggableListItem "+t[4].name)+" svelte-9vv5ub"),attr(e,"draggable",!0),toggle_class(e,"delete",t[147]._delete),toggle_class(e,"is-active-top",t[30]?.top===t[149]),toggle_class(e,"is-active-bottom",t[30]?.bottom===t[149])},m(r,a){insert(r,e,a),append(e,n),o||(i=[listen(e,"dragover",t[64]),listen(e,"dragleave",t[65](t[149])),listen(e,"dragstart",t[62](t[149])),listen(e,"drop",prevent_default(t[61](t[149]))),listen(e,"dragenter",t[63](t[149]))],o=!0)},p(o,i){t=o,65536&i[0]&&a!==(a=t[52](t[16],t[149])+"")&&set_data(n,a),16&i[0]&&r!==(r=null_to_empty("draggableListItem "+t[4].name)+" svelte-9vv5ub")&&attr(e,"class",r),32784&i[0]&&toggle_class(e,"delete",t[147]._delete),1073741840&i[0]&&toggle_class(e,"is-active-top",t[30]?.top===t[149]),1073741840&i[0]&&toggle_class(e,"is-active-bottom",t[30]?.bottom===t[149])},d(t){t&&detach(e),o=!1,run_all(i)}}}function create_if_block_7$1(t){let e,n,r;var o=t[153];return o&&(e=new o({props:{size:"20"}})),{c(){e&&create_component(e.$$.fragment),n=empty()},m(t,o){e&&mount_component(e,t,o),insert(t,n,o),r=!0},p(t,r){if(o!==(o=t[153])){if(e){group_outros();const t=e;transition_out(t.$$.fragment,1,0,()=>{destroy_component(t,1)}),check_outros()}o?(e=new o({props:{size:"20"}}),create_component(e.$$.fragment),transition_in(e.$$.fragment,1),mount_component(e,n.parentNode,n)):e=null}},i(t){r||(e&&transition_in(e.$$.fragment,t),r=!0)},o(t){e&&transition_out(e.$$.fragment,t),r=!1},d(t){t&&detach(n),e&&destroy_component(e,t)}}}function create_each_block_2$1(t){let e,n,r,o,i,a=!t[1]&&!t[4].readonly&&create_if_block_7$1(t);return{c(){e=element("span"),a&&a.c(),attr(e,"class","pointer icon svelte-9vv5ub"),attr(e,"title",t[151]),e.hidden=n=t[149]===t[15].length-1||!(t[147]._delete^t[152])},m(n,s){insert(n,e,s),a&&a.m(e,null),r=!0,o||(i=listen(e,"click",function(){is_function(t[60](t[149],t[12],t[150]))&&t[60](t[149],t[12],t[150]).apply(this,arguments)}),o=!0)},p(o,i){(t=o)[1]||t[4].readonly?a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()):a?(a.p(t,i),18&i[0]&&transition_in(a,1)):(a=create_if_block_7$1(t),a.c(),transition_in(a,1),a.m(e,null)),(!r||32768&i[0]&&n!==(n=t[149]===t[15].length-1||!(t[147]._delete^t[152])))&&(e.hidden=n)},i(t){r||(transition_in(a),r=!0)},o(t){transition_out(a),r=!1},d(t){t&&detach(e),a&&a.d(),o=!1,i()}}}function create_handle_slot(t){let e,n,r,o,i,a=!t[10]&&create_if_block_8$1(t),s=[{title:"löschen",toDelete:!0,icon:DeleteIcon},{title:"undo",toDelete:!1,icon:CornerDownLeftIcon}],c=[];for(let e=0;e<2;e+=1)c[e]=create_each_block_2$1(get_each_context_2$1(t,s,e));const l=t=>transition_out(c[t],1,1,()=>{c[t]=null});return{c(){e=element("div"),a&&a.c(),n=space();for(let t=0;t<2;t+=1)c[t].c();r=space(),attr(e,"class",o=null_to_empty("accordion "+t[4].name)+" svelte-9vv5ub"),attr(e,"slot","handle")},m(t,o){insert(t,e,o),a&&a.m(e,null),append(e,n);for(let t=0;t<2;t+=1)c[t].m(e,null);append(e,r),i=!0},p(t,d){if(t[10]?a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()):a?(a.p(t,d),1024&d[0]&&transition_in(a,1)):(a=create_if_block_8$1(t),a.c(),transition_in(a,1),a.m(e,n)),36882&d[0]|536870912&d[1]|67108864&d[4]){let n;for(s=[{title:"löschen",toDelete:!0,icon:DeleteIcon},{title:"undo",toDelete:!1,icon:CornerDownLeftIcon}],n=0;n<2;n+=1){const o=get_each_context_2$1(t,s,n);c[n]?(c[n].p(o,d),transition_in(c[n],1)):(c[n]=create_each_block_2$1(o),c[n].c(),transition_in(c[n],1),c[n].m(e,r))}for(group_outros(),n=2;n<2;n+=1)l(n);check_outros()}(!i||16&d[0]&&o!==(o=null_to_empty("accordion "+t[4].name)+" svelte-9vv5ub"))&&attr(e,"class",o)},i(t){if(!i){transition_in(a);for(let t=0;t<2;t+=1)transition_in(c[t]);i=!0}},o(t){transition_out(a),c=c.filter(Boolean);for(let t=0;t<2;t+=1)transition_out(c[t]);i=!1},d(t){t&&detach(e),a&&a.d(),destroy_each(c,t)}}}function create_each_block_1$1(t){let e,n,r=(!t[2]&&!t[1]||t[149]<t[15].length-1)&&create_if_block_6$1(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){!t[2]&&!t[1]||t[149]<t[15].length-1?r?(r.p(t,n),32774&n[0]&&transition_in(r,1)):(r=create_if_block_6$1(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_default_slot_4$1(t){let e,n,r=t[15],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_1$1(get_each_context_1$1(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(1612554239&n[0]|2146042369&n[1]|127&n[2]|71303168&n[4]){let a;for(r=t[15],a=0;a<r.length;a+=1){const i=get_each_context_1$1(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block_1$1(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block$1(t){let e,n,r;function o(e){t[88](e)}let i={$$slots:{default:[create_default_slot$2,({closeCallback:t})=>({142:t}),({closeCallback:t})=>[0,0,0,0,t?262144:0]]},$$scope:{ctx:t}};return void 0!==t[22]&&(i.open=t[22]),e=new t[32]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};529006592&r[0]|262144&r[4]|16&r[5]&&(o.$$scope={dirty:r,ctx:t}),!n&&4194304&r[0]&&(n=!0,o.open=t[22],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_else_block_1$1(t){let e,n;return{c(){e=element("td"),n=text(t[24])},m(t,r){insert(t,e,r),append(e,n)},p(t,e){16777216&e[0]&&set_data(n,t[24])},d(t){t&&detach(e)}}}function create_if_block_5$1(t){let e,n,r,o;return{c(){e=element("td"),n=element("input"),attr(n,"id","reader_focusId"),n.autofocus=!0,n.value=t[23]},m(i,a){insert(i,e,a),append(e,n),n.focus(),r||(o=[listen(n,"focus",t[72]),listen(n,"input",function(){is_function(t[78](t[19].keyboard.length))&&t[78](t[19].keyboard.length).apply(this,arguments)})],r=!0)},p(e,r){t=e,8388608&r[0]&&n.value!==t[23]&&(n.value=t[23])},d(t){t&&detach(e),r=!1,run_all(o)}}}function create_if_block_4$1(t){let e,n,r,o,i,a=t[73](t[19].refItem,!0)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" nicht gefunden!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){524288&e[0]&&a!==(a=t[73](t[19].refItem,!0)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_3$1(t){let e,n,r,o,i,a=t[73](t[19].refItem)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" bereits eingefügt!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){524288&e[0]&&a!==(a=t[73](t[19].refItem)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_1$1(t){let e;let n=function(t){return"number"===t[143].type?create_if_block_2$1:create_else_block$1}(t),r=n(t);return{c(){r.c(),e=empty()},m(t,n){r.m(t,n),insert(t,e,n)},p(t,e){r.p(t,e)},d(t){r.d(t),t&&detach(e)}}}function create_else_block$1(t){let e;return{c(){e=element("input"),attr(e,"id","reader_"+t[143].name),attr(e,"type","text")},m(t,n){insert(t,e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block_2$1(t){let e,n,r;return{c(){e=element("input"),set_style(e,"width","4em"),attr(e,"id","reader_"+t[143].name),attr(e,"type","number"),attr(e,"min","0")},m(o,i){insert(o,e,i),n||(r=listen(e,"input",function(){is_function(t[78](t[19].keyboard.length,t[143]))&&t[78](t[19].keyboard.length,t[143]).apply(this,arguments)}),n=!0)},p(e,n){t=e},d(t){t&&detach(e),n=!1,r()}}}function create_each_block$1(t){let e,n,r,o,i,a,s=t[73](t[143].name)+"",c=t[25]&&create_if_block_1$1(t);return{c(){e=element("tr"),n=element("th"),r=text(s),o=space(),i=element("td"),c&&c.c(),a=space()},m(t,s){insert(t,e,s),append(e,n),append(n,r),append(e,o),append(e,i),c&&c.m(i,null),append(e,a)},p(t,e){t[25]?c?c.p(t,e):(c=create_if_block_1$1(t),c.c(),c.m(i,null)):c&&(c.d(1),c=null)},d(t){t&&detach(e),c&&c.d()}}}function create_default_slot_3$1(t){let e;return{c(){e=text("Verwerfen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_2$1(t){let e;return{c(){e=text("Speichern")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_1$1(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$,y,b,v,I,C=t[73](t[19].refItem)+"";function E(e){t[87](e)}let A={keyboard:t[19].keyboard,codeTypes:t[19].codeTypes};function S(t,e){return t[19].keyboard?create_if_block_5$1:create_else_block_1$1}void 0!==t[27]&&(A.readerInit=t[27]),e=new InputReader({props:A}),binding_callbacks.push(()=>bind(e,"readerInit",E)),e.$on("scan",t[71]),e.$on("exit",t[76]);let k=S(t),T=k(t);function R(t,e){return t[28]?create_if_block_3$1:t[24]&&!t[26]?create_if_block_4$1:void 0}let N=R(t),D=N&&N(t),x=t[47],O=[];for(let e=0;e<x.length;e+=1)O[e]=create_each_block$1(get_each_context$1(t,x,e));return y=new t[35]({props:{disabled:!t[24],outline:!0,style:"float: left;",$$slots:{default:[create_default_slot_3$1]},$$scope:{ctx:t}}}),y.$on("click",t[74]),v=new t[35]({props:{disabled:!t[26],filled:!0,style:"float: right;",$$slots:{default:[create_default_slot_2$1]},$$scope:{ctx:t}}}),v.$on("click",t[75]),{c(){create_component(e.$$.fragment),r=space(),o=element("div"),i=element("table"),a=element("tr"),s=element("th"),s.textContent="Code",c=space(),T.c(),l=space(),d=element("tr"),u=element("th"),h=text(C),m=space(),f=element("td"),p=element("div"),_=text(t[25]),g=space(),D&&D.c(),w=space();for(let t=0;t<O.length;t+=1)O[t].c();$=space(),create_component(y.$$.fragment),b=space(),create_component(v.$$.fragment),set_style(p,"max-width","14em"),set_style(i,"margin-top","1em"),set_style(i,"margin-bottom","1em"),set_style(i,"text-align","left"),set_style(o,"position","relative"),set_style(o,"z-index","1000"),set_style(o,"background-color","white"),set_style(o,"height","225px")},m(t,n){mount_component(e,t,n),insert(t,r,n),insert(t,o,n),append(o,i),append(i,a),append(a,s),append(a,c),T.m(a,null),append(i,l),append(i,d),append(d,u),append(u,h),append(d,m),append(d,f),append(f,p),append(p,_),append(i,g),D&&D.m(i,null),append(i,w);for(let t=0;t<O.length;t+=1)O[t].m(i,null);append(o,$),mount_component(y,o,null),append(o,b),mount_component(v,o,null),I=!0},p(t,r){const o={};if(524288&r[0]&&(o.keyboard=t[19].keyboard),524288&r[0]&&(o.codeTypes=t[19].codeTypes),!n&&134217728&r[0]&&(n=!0,o.readerInit=t[27],add_flush_callback(()=>n=!1)),e.$set(o),k===(k=S(t))&&T?T.p(t,r):(T.d(1),T=k(t),T&&(T.c(),T.m(a,null))),(!I||524288&r[0])&&C!==(C=t[73](t[19].refItem)+"")&&set_data(h,C),(!I||33554432&r[0])&&set_data(_,t[25]),N===(N=R(t))&&D?D.p(t,r):(D&&D.d(1),D=N&&N(t),D&&(D.c(),D.m(i,w))),34078720&r[0]|65536&r[1]|67584&r[2]){let e;for(x=t[47],e=0;e<x.length;e+=1){const n=get_each_context$1(t,x,e);O[e]?O[e].p(n,r):(O[e]=create_each_block$1(n),O[e].c(),O[e].m(i,null))}for(;e<O.length;e+=1)O[e].d(1);O.length=x.length}const s={};16777216&r[0]&&(s.disabled=!t[24]),16&r[5]&&(s.$$scope={dirty:r,ctx:t}),y.$set(s);const c={};67108864&r[0]&&(c.disabled=!t[26]),16&r[5]&&(c.$$scope={dirty:r,ctx:t}),v.$set(c)},i(t){I||(transition_in(e.$$.fragment,t),transition_in(y.$$.fragment,t),transition_in(v.$$.fragment,t),I=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(y.$$.fragment,t),transition_out(v.$$.fragment,t),I=!1},d(t){destroy_component(e,t),t&&detach(r),t&&detach(o),T.d(),D&&D.d(),destroy_each(O,t),destroy_component(y),destroy_component(v)}}}function create_default_slot$2(t){let e,n;return e=new t[33]({props:{title:"Scannen",class:"reader",closeCallback:t[142],$$slots:{default:[create_default_slot_1$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};262144&n[4]&&(r.closeCallback=t[142]),529006592&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_pending_block$1(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$2(t){let e,n,r={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$1,then:create_then_block$1,catch:create_catch_block$1,value:141,blocks:[,,,]};return handle_promise(t[51](),r),{c(){e=empty(),r.block.c()},m(t,o){insert(t,e,o),r.block.m(t,r.anchor=o),r.mount=()=>e.parentNode,r.anchor=e,n=!0},p(e,n){update_await_block_branch(r,t=e,n)},i(t){n||(transition_in(r.block),n=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(r.blocks[t])}n=!1},d(t){t&&detach(e),r.block.d(t),r.token=null,r=null}}}let _praefix=new Map;const setPraefix=(t,e)=>{_praefix.set(e,t)},getPraefix=t=>{const e=_praefix.get(t);return void 0===e?t:e},noForm=!0,dragId="pos/target";function _delay(t){return new Promise(e=>{setTimeout(e,t)})}function instance$2(t,e,n){let r,o,i;const{Modal:a,Dialog:s,FormField:c,TextField:l,Button:d,Accordion:u,AccordionSection:h,Divider:m}=getAttractions,f=createEventDispatcher(),{loggedIn:p}=user;component_subscribe(t,p,t=>n(96,i=t));let{list:_}=e,{mainSchema:g}=e,{schema:w}=e,{record:$}=e,{multiValues:y}=e,{classId:b}=e,{eventId:v}=e,{disabled:I}=e,{fixed:C}=e,{template:E={}}=e,{reqQuantity:A}=e,{open:S=!1}=e,{currency:k}=e,{notifyList:T}=e,{shortEdit:R}=e,{dateInput:N}=e;const D=w.find(t=>"price"===t.name&&!t.properties?.hidden),x=w.find(t=>"amount"===t.name&&!t.properties?.hidden)||w.find(t=>t.isAmount&&!t.properties?.hidden),O=w.find(t=>"quantity"===t.name&&!t.properties?.hidden),M=x||D&&O,P=M&&O;let B=0;const F=w.find(t=>"quantity"===t.name&&"h"===t.properties?.unit?.constant&&!t.properties?.hidden);let L=0;const q=w.find(t=>"number"===t.type&&"w"===t.properties?.unit?.constant?.toLowerCase()&&!t.properties?.hidden)?.name||"",V=!!q;let H=0,U=!1;const z={},W=_.reader;let j,G,X,Q=w.properties?.readonly,Y=b.split("form-")[1].slice(0,-4),Z=new Map,K="",J=!0,tt="",et="",nt="",rt=!1,ot=!1,it=!1;const at=w.filter(t=>t.properties?.reader);let st=new Map;_.group&&(C=!0);const ct={},lt=new Map,dt=_.item.filter(t=>"number"===t.type&&!!t.properties?.transfer);I||=Q;let ut,ht,mt=[],ft=[],pt=!1,_t={},gt=[];const wt=async t=>{if("saleDelivery"!==_.name||!ut?.length||t[_.name]?.length){if(n(3,A=t.quantity),R)n(15,ut=t[_.name]||[]);else if(!t._id&&_.filter){const t=ut;n(15,ut=[]);const e=await Lt();n(15,ut=!1!==e?e.concat({}):t)}else n(15,ut=((t,e)=>{let n=t[e];if(n?.length||(n=[]),n=n.concat({}),t._id)return n;for(const e of w)e.preset&&!n[0][e.name]&&(n[0][e.name]=t[e.preset]);return n})(t,_.name)||[{}]);qt(t)}};w.filter(t=>t.selection).map(t=>mt.push({className:Y,parentClass:w,refClass:t.selection,value:""}));["readonly","hidden","required"].map(t=>{w.filter(e=>"object"==typeof(e.properties&&e.properties[t])).map(e=>{const n=e.properties[t].refItem||"",r=e.properties[t].refValue;let[o,i]=n.split(".");i||(i=o,o=void 0),gt.push({action:t,itemName:e.name,refObj:o,refName:i,refValue:r,op:e.properties[t].invert?"!":""})})});const $t=(t,e=!1)=>{if(!t)return"";try{if(t.split&&3===t.split("-").length)return new Date(t)?.toISOString();if(t.split&&3===t.split(".").length){const[e,n,r]=t.split("."),o=new Date(r,n-1,e);if(!isNaN(o))return o.toISOString()}}catch{}return e?t:""},yt=t=>t.slice(0,3).join(", "),bt=(t,e,o)=>async({detail:i})=>{const{oldValue:a,value:s,add:c}=i;if(a&&!s){const t=w.find(t=>t.refItem===e.refClass&&t._formulaActor);t&&Tt(o,t._formulaActor,!0)}if(s&&e.refClass){const t="p$"+e.refClass+"$"+v;let n=await getList2(t);0===n?.length&&(await _delay(500),n=await getList2(t)),n&&n.find(({_id:t})=>t==s)||await getTaskFull(e.refClass,s)}let{desc:l}=i;if(""===a&&""===s&&(l=""),t.refItem){const r=await Ct(t,o,e,t.refItem);r&&n(15,ut=r)}Tt(o,e._formulaActor);const d=mt?.find(t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass);d&&(d.value=(d.value||new Map).set(o,s)),s&&ut.length===o+1&&!R&&n(15,ut=ut.concat({})),l&&n(82,z[s]=l,z),R||await Nt(t,o,e,s,a),await At(o,e.name),n(16,r=ut),"number"===e.type&&n(31,_t={item:e,value:s,idx:o}),await vt(o),St(o)},vt=async t=>{if(ut[t]&&!_.filter&&ut.length!==t+1)for(const e of w.filter(t=>!!t.refProp)){let r,o=$[e.refItem]||ut[t][e.refItem];if(!o)continue;if(Array.isArray(o)){if(ut[t][e.name])continue;o=o[t][e.refItem]}const i="p$"+e.refItem+"$"+v;let a=await getList2(i);if(a&&(r=a.find(({_id:t})=>t==o)),r||(r=await getTaskFull(e.refItem,o)),!r)continue;const s=It(r,e.refProp)?.replace(",",".")||r[e.refProp]&&r[e.refProp][e.name]?.replace(",",".")||r[e.refProp];ut[t][e.name]||n(15,ut[t][e.name]=s,ut)}},It=(t,e)=>{try{return t.split(".").reduce((t,e)=>t[e],e)}catch(t){return""}},Ct=async(t,e,n,r)=>{if(t.filter)return;const o=$[r];if(!o?.length)return;const i=o[0][r];if(!i)return;const a=await getTaskFull(r,i);return a?a[t.name]:void 0},Et=(t,e,r,o)=>{if(!t.filter){if(o&&!1===r.refItem){const t="boolean"!==r.type&&"";ut[e][r.name]&&n(15,ut[e][r.name]=t,ut)}ut.length!==e+1&&"number"==typeof r.properties?.value&&n(15,ut[e][r.name]=r.properties.value,ut)}},At=async(t,e)=>{const r=gt.filter(t=>(t.refObj||Y)===e||t.refName===e);if(r?.length)for(const e of r){const{itemName:r,refObj:o,refName:i,refValue:a,op:s}=e;let c,l,{action:d}=e,u=!1,h=!1;if(o){const e=ut[t][o];o===Y&&i?u=$:e&&(u=await getTaskFull(o,e))}!o&&i&&(u=ut[t]),u&&(h=u[i],Array.isArray(h)&&0===h.length?h=!1:a&&(h=h==(u[a]||$[a]))),"!"===s&&(h=!h),"required"!==d&&"readonly"!==d||(d="required"===d?d:"disabled",setTimeout(()=>{c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r} .field textarea`,l=document.querySelector(c),l||(c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r} .field input#${"dp-"+r+"-"+t}`,l=document.querySelector(c)),l||(c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r} .field input`,l=document.querySelector(c)),l&&h&&l.setAttribute(d,""),l&&!h&&l.removeAttribute(d)},0)),"hidden"===d&&(c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r}`,l=document.querySelector(c),l?.classList?.toggle("hidden",h),h&&n(15,ut[t][r]="",ut))}},St=(t,e)=>{let r=`#accordion-content-${b}-${_.name}-${t} .form-field:not(.hidden) .field :required:not(:disabled)`;const o=document.querySelectorAll(r);let i=!1;o.forEach(t=>{!t.id.startsWith("dp-")&&t.required&&""===t.value&&(i=!0)}),void 0===e&&(r=`#accordion-content-${b}-${_.name}-${t} :not(.form-field.hidden) .field input.invalid`,document.querySelector(r)&&(e=!0)),n(29,ft[t]=i||e?"invalid":"",ft)},kt=t=>{if(!t)return 0;const[e,n=0]=t.split(":");return 60*e+parseInt(n)},Tt=(t,e,r=!1)=>{if(!e)return;const o=w.find(t=>t.name===e);if(!o)return;const i=o.properties.value.formula,{operator:a,argument:s}=i,c=s.map(e=>ut[t][e.refItem]||$[e.refItem]);let l=0;if("$preferred"===a&&(l=r?"":c.reduce((t,e)=>{let n=t;return"number"===o.type?n=+n||+e:n||=e,n})),"$add"===a&&(l=c.reduce((t,e)=>+(t||0)+ +(e||0))),"$subtract"===a&&(l=c.reduce((t,e)=>{t||(t=""),e||(e=""),"number"==typeof t&&(t=t.toString());const[n,r]=t.split(":");t=r?(+n+ +r/60).toFixed(2):+(n||0);let[o,i]=e.split(":");return o||(o=0),t-=i?(+o+ +i/60).toFixed(2):+(o||0)})),"$multiply"===a&&(l=c.reduce((t,e)=>+(t||0)*+(e||0))),"$percentMultiply"===a){const[t,e]=c;l=+t,+e>0&&(l*=1-e/100)}if("$percentDivide"===a){const[t,e]=c;0!=+e&&(l=+t/+e*100)}if("$percentSubtract"===a){let[t,e]=c;e.replace&&(e=e.replace(",",".")),0!=+e&&(l=+t-t*+e/100)}const d=`#accordion-content-${b}-${_.name}-${t} .form-field.${e} .field input`,u=document.querySelector(d),h=u?.disabled;n(15,ut[t][e]="$multiply"===a?l?Rt(l,o.properties?.decimals):"":Rt(l,o.properties?.decimals),ut),n(31,_t={item:o,value:l,idx:t}),setTimeout(()=>{const e=document.querySelector(d);h&&e&&e.setAttribute("disabled",""),o._formulaActor&&Tt(t,o._formulaActor)},0)},Rt=(t,e)=>("number"==typeof t&&t||(t=Number(t||0)),t.toFixed(e||0));ht=w.filter(t=>t.refClass).reduce((t,e)=>{const n=w.filter(t=>t.refItem===e.refClass);if(!n?.length)return t;if(e.selection){const[n,r]=e.selection.split(":"),[o]=r?.split(".")||[];o&&t.push({refClass:o,items:[n],selection:e.selection})}const r={refClass:e.refClass,items:[]};return n.forEach(t=>{r.items.push(t.name)}),t.push(r),t},[]);const Nt=async(t,e,r,o,i)=>{if(t.filter)return;const a=(await ht).find(t=>t.refClass===r.refClass);if(!a)return;const{refClass:s,items:c,selection:l}=a,d=r.name;if(gt.find(t=>t.itemName===d)){const n=`#accordion-content-${b}-${t.name}-${e} .form-field.${s}.hidden`;if(document.querySelector(n))return}return o?Promise.all(c.map(async t=>{let a=w.find(e=>e.name===t);if(!a)return;let d=a.refName||a.name,u="",h="";if(a.lookup){if(h=ut[e][a.name],n(15,ut[e][a.name]="",ut),!ut[e][a.refItem])return void n(15,ut[e][a.name]="",ut);let[t,r,o]=a.lookup.split(".");o||(o=r,r="");const i=a.lookupRefItem||a.refItem,s=a.lookupRefName||d,c="p$"+a.refItem+"$"+v;let l,m=await getList2(c);if(l=m?.find(({_id:t})=>t==ut[e][a.refItem]),l||(l=await getTaskFull(a.refItem,ut[e][a.refItem])),l){if(a.refItem2){const t=await getTaskFull(a.refItem2,l[a.refItem2]);if("dealerPrice"===d&&$.branch){const t=await getTaskFull("branch",$.branch);t?.sector?.includes("Privat")&&(d="price")}t&&(u=t[d])}0===+u&&(u=l[d])}if($[t]){const n=await getTaskFull(t,$[t]);if(n&&n[r]){const t=await getTaskFull(r,n[r]);if(t){const n=t[o].find(t=>t[i]===ut[e][i]);n&&(u=n[s])}}else if(n&&n[o]){const t=n[o].find(t=>t[i]===ut[e][i]);t&&(u=t[s])}}return ut[e][a.name]||n(15,ut[e][a.name]=u||h,ut),void await Tt(e,a._formulaActor)}if(a.properties?.readonly&&!r.refInput){const o=ut[e][r.refClass];return Promise.resolve(getTaskFull(r.refClass,o,!0)).then(r=>{let o=a.refPos?r[a.refPos]||It(a.refPos,r):r[t];void 0!==a.factor&&(o*=a.factor),Array.isArray(o)&&(o=o.length?o[0][t]:""),n(15,ut[e][t]=o,ut),a._formulaActor&&Tt(e,a._formulaActor)})}const{refInput:m}=r;if(m&&ut[e]){const[t,n]=m.split(".");u=n?ut[e][n]:$[t]}if(l&&o!==i)c.map(t=>{n(15,ut[e][t]="",ut)});else{if(a.refItem2){const[r,o]=a.refItem2.split(".");$[r]&&getTaskFull(r,$[r]).then(r=>{r&&+r[o]&&n(15,ut[e][t]=r[o],ut)})}if(m&&!u||Dt(e,t)||i!==o){const o=w.find(t=>t.refClass===s),i=ut[e][o.name];if(r.selection){const o=getTaskSelection(r.selection+i.toString());if(o)return Promise.resolve(o).then(r=>n(15,ut[e][t]=r[t],ut))}const a="p$"+o.refClass+"$"+v;let c=await getList2(a);if(c){const r=c.find(({_id:t})=>t==i);if(r)return Promise.resolve(()=>{n(15,ut[e][t]=r[t],ut)})}return Promise.resolve(getTaskFull(o.refClass,i)).then(r=>n(15,ut[e][t]=r[t],ut))}}})):Promise.resolve(c.map(t=>{n(15,ut[e][t]="",ut)}))},Dt=(t,e)=>{let n=ut[t][e];return"number"===w.find(t=>t.name===e).type&&(n=Number(n||0)),!n},xt=t=>{if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n}px`)};let Ot=!1;const Mt=t=>!(!C&&t>=ut.length-1),Pt=(t,e=!1)=>{const[n,r]=t.split(";");return _.name===r&&(!!Mt(e)&&((!1===e||e!=n)&&parseInt(n)))};w.filter(t=>t.properties?.value?.formula?.argument).forEach(t=>{t.properties.value.formula.argument.forEach(e=>{const n=w.find(t=>t.name===e.refItem)||w.find(t=>t.name===e.refItem);n&&(n._formulaActor=t.name)})});const Bt=(t,e=!1)=>{const r=`#accordion-content-${b}-${_.name}-${t} > div.form-field:not(.hidden)`,o=document.querySelectorAll(r);if(!o?.length)return;const i=o[o.length-1];tick().then(()=>{const e=`#accordion-content-${b}-${_.name}-${t} textarea`;Array.from(document.querySelectorAll(e)).forEach(xt)}).then(()=>{e&&i.scrollIntoView({behavior:"smooth",block:"end"})});for(const e of w){"number"==typeof e.properties?.value&&n(15,ut[t][e.name]=e.properties.value,ut);const r=_.preserve&&_.preserve.includes(e.preset);if(e.preset&&!r&&!ut[t][e.name]){const r=lt.get(e.preset);r&&n(15,ut[t][e.name]=r,ut)}!$._id&&e.refItem&&$[e.refItem]&&getTaskFull(e.refItem,$[e.refItem]).then(r=>n(15,ut[t][e.name]=r[e.name],ut))}if(!(t<1)&&ut?.length&&t===ut.length-1&&_.preserve&&!$._id)for(const e of _.preserve){if(!ut[t-1][e])continue;const r=$t(ut[t-1][e],!0);n(15,ut[t][e]=r,ut),lt.set(e,r)}},Ft=new Map,Lt=async()=>{if(!_.filter)return[];let t,e,n,{date:r,level:o,isDealer:i}=$;if(r)[t,e,n]=r.split(".");else{r=(new Date).toISOString();const o=r.split("T")[0];[n,e,t]=o.split("-")}const a=`${n}-${e}-${t}`,s=Ft.get("dv"),c=Ft.get("lv"),l=Ft.get("iv");if(s===a&&c===o&&l===!!i)return!1;let d;Ft.set("dv",a),Ft.set("lv",o),Ft.set("iv",!!i),d=i?{$ne:""}:{$eq:""};const u={dealer:d,"_task.status":"Ready",payable:{$lt:a},_total:{$gt:0}};o&&(u.levelReminder=o),o||(u.levelReminder={$in:[void 0,!1,""]});const h=[{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:u},{$sort:{payable:1,invoiceId:1}}];return await Request.getSectionView("invoice",h)},qt=async t=>{if(!_.filter){if(t[_.name]?.length)for(const e of w)if((e.properties?.prefetch||1e3)<t[_.name].length){const n="p$"+e.refClass+"$"+v;if(getList2(n))continue;setList(n,[]);const r=Vt(t[_.name],e.name);r?.length&&setList(n,Request.getSectionView(e.refClass,{_id:{$in:r}}))}n(20,j={record:t})}},Vt=(t,e)=>Array.from(new Set(t.map(t=>t[e]).filter(t=>!!t))),Ht=()=>{n(28,ot=!1),n(25,et=""),n(23,K=""),J=!0,n(24,tt=""),n(26,nt=""),n(22,X=!0)},Ut=async({detail:t})=>{const{refItem:e,refValue:r,refDescription:o,keyboard:i,input:a}=W;let s,c="reader_";for(;t.text.length>i.length;)t.text=t.text.slice(1);if(tt===t.text&&t.item){const e=c+t.item.name;return s=document.getElementById(e),s.value=+(st.get(t.item.name)||0)+1,st.set(t.item.name,s.value),s.focus(),J=!0,void n(23,K="")}if(n(28,ot=!1),n(25,et=""),n(24,tt=t.text||""),!tt)return;const l=w.find(t=>t.name===e)?.refClass;if(!l)return;let d=await Request.getSectionView(l,{[r]:tt});d?.length?(d=d[0],n(26,nt=d._id),n(25,et=o.map(t=>d[t]).join(", ")),n(28,ot=ut.find(t=>t[e]===nt)),setTimeout(()=>{w.filter(t=>t.properties?.reader).forEach(t=>{const e=document.getElementById("reader_"+t.name);e&&(e.value=st.get(t.name)||(ot?ot[t.name]:"")),st.set(t.name,e.value)});let e=1;if(a){const{refItem:t,refValue:n}=a;for(const r of n){const{value:n,factor:o}=r,i=d[t];n.includes(","+i.split("-")[0]+"-,")&&(e=o)}}if(t.item){const n=c+t.item.name;s=document.getElementById(n),s.value=+(st.get(t.item.name)||0)+e,st.set(t.item.name,s.value),s.focus()}else{const t=w.find(t=>t.properties?.reader).name,n=c+t;s=document.getElementById(n),s.value=+(st.get(t)||0)+e,st.set(t,s.value),s.focus()}J=!0,n(23,K="")},0)):setTimeout(()=>{J=!0,n(23,K=""),n(24,tt=""),st=new Map;const t=document.getElementById("reader_focusId");t&&t.focus()},0)},zt=()=>{n(25,et=""),n(26,nt=""),n(28,ot=!1),n(27,rt=!0),Wt(),st=new Map},Wt=()=>{if(!W.keyboard)return;const t=document.getElementById("reader_focusId");t&&t.focus()};onMount(async()=>{if(!_.filter&&(G||n(21,G=await Request.getEvent(v)),($._id||!G.input)&&!(ut.length>1)&&!I&&W?.autostart)){if("object"==typeof W.autostart){if(!W.autostart.user)return;{const t=i.user,[e,n]=W.autostart.user.split(":"),r=g.find(t=>t.name===e),o=r?.refClass;if(!o||!n)return;const a=await getTaskFull(o,$[e]);if(!a)return;if(a[n]!==t)return}}else if(!0!==W.autostart)return;it=!1,Ht()}});return t.$$set=t=>{"list"in t&&n(4,_=t.list),"mainSchema"in t&&n(79,g=t.mainSchema),"schema"in t&&n(80,w=t.schema),"record"in t&&n(0,$=t.record),"multiValues"in t&&n(5,y=t.multiValues),"classId"in t&&n(6,b=t.classId),"eventId"in t&&n(7,v=t.eventId),"disabled"in t&&n(1,I=t.disabled),"fixed"in t&&n(2,C=t.fixed),"template"in t&&n(81,E=t.template),"reqQuantity"in t&&n(3,A=t.reqQuantity),"open"in t&&n(12,S=t.open),"currency"in t&&n(8,k=t.currency),"notifyList"in t&&n(9,T=t.notifyList),"shortEdit"in t&&n(10,R=t.shortEdit),"dateInput"in t&&n(11,N=t.dateInput)},t.$$.update=()=>{if(528&t.$$.dirty[0]&&T&&!_.filter){const{itemName:t,value:e}=T;lt.set(t,e),t&&t===_.name&&n(0,$[t]=e,$)}1&t.$$.dirty[0]&&wt($),32768&t.$$.dirty[0]&&n(16,r=ut),122896&t.$$.dirty[0]&&r&&((()=>{if(F)n(17,L=ut?.reduce((t,e)=>t+(e._delete?0:+(e.quantity||0)),0)||0)})(),(()=>{if(V)n(14,H=ut?.reduce((t,e)=>t+(e._delete?0:+(e[q]||0)),0)||0)})(),(()=>{if(M)n(13,B=ut?.reduce((t,e)=>{if(e.amount){const n=e.amount??0;t+=e._delete?0:+n}else if(e.price){const n=(P?e.quantity??0:1)*(e.price??0);t+=e._delete?0:n}else if(e.value){const n=e.value??0;t+=e._delete?0:+n}return t},0)||0)})(),tick().then(()=>f("save",{listName:_.name,value:ut,amountValue:B,weeksValue:H}))),1048576&t.$$.dirty[2]&&(o=t=>z[t]?.split(" • ").filter(t=>!!t&&!/^[0-9a-f]{24}/.test(t)).slice(0,2).join(" · "))},[$,I,C,A,_,y,b,v,k,T,R,N,S,B,H,ut,r,L,U,W,j,G,X,K,tt,et,nt,rt,ot,ft,pt,_t,a,s,c,d,u,h,m,p,undefined,M,{name:"amountValue",properties:{decimals:2}},F,{name:"hoursValue",properties:{decimals:2}},V,{name:"weeksValue",properties:{decimals:1}},at,lt,dt,mt,async()=>{if(!I&&(G||n(21,G=await Request.getEvent(v)),($._id||!G.input)&&W&&!W.keyboard))try{const t=await getCameras$1();t?.length||n(19,W=!1)}catch{}},(t,e)=>{let n=t[e];return ct["pos"+e]&&(n=ct["pos"+e]),n&&w.filter(t=>!0!==t.properties?.hidden&&("dateRange"===t.type||void 0!==n[t.name])&&"textarea"!==t.properties?.format).map(t=>""===n[t.name]?"":"object"===t.type?o(n[t.name]):Array.isArray(n[t.name])?yt(n[t.name]):"boolean"===t.type?checkBoolean(n[t.name]):"number"===t.type?Rt(n[t.name],t.properties?.decimals||0):"dateRange"===t.type?checkDateRange(t.name,n):"date"===t.type?checkDate($t(n[t.name])):"datetime"===t.type?checkDateTime(n[t.name]):t.properties?.multi?"":n[t.name]).filter(t=>!!t).join(" • ")||"+"},t=>({detail:{row:e}})=>{if(f("task",{row:e}),!$._id&&e._id){for(let e=0;e<ut.length;e++)for(const n of t.item)Et(t,e,n,!U);n(18,U=!0)}},bt,({detail:t})=>{const{idx:e,value:n}=t;St(e,n)},async({detail:{className:t,itemName:e,value:n}})=>{if(Z.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===Y+"."+_.name)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&Z.set(t,o[0])},({detail:t})=>{const{idx:e,fieldId:n,value:r}=t;if(!r)return;const o=kt(r);let i=!1;ut.forEach((t,n)=>{if(e===n)return;const{start:r,end:a}=ut[n];r&&a&&o>kt(r)&&o<kt(a)&&(i=!0)});const a=document.getElementById(n);a?.classList?.toggle("invalid",i)},t=>({detail:e})=>{e.string?n(15,ut[t][e.itemName]=e.value,ut):n(15,ut[t][e.itemName]=Rt(e.value,e.decimals),ut)},(t,e,n)=>n=>{ut[e]._delete||(t(n),Bt(e,!0))},(t,e,r)=>o=>{if(n(15,ut[t]._delete=!ut[t]._delete,ut),ut[t]._delete){ct["pos"+t]={...ut[t]};for(const e of w)n(15,ut[t][e.name]="",ut);e&&r(o)}else{if(ct["pos"+t]){const e={};for(const n of w)e[n.name]=ct["pos"+t][n.name];n(15,ut[t]=e,ut)}ct["pos"+t]=void 0,e||r(o)}},t=>e=>{e.preventDefault(),n(30,pt=!1);const r=Pt(e.dataTransfer.getData(dragId),t);if(!1===r)return;e.dataTransfer.dropEffect="move";const o=[...ut].map((t,e)=>(t._index=e,t));r<t?(o.splice(t+1,0,o[r]),o.splice(r,1)):(o.splice(t,0,o[r]),o.splice(r+1,1)),o.map((t,e)=>setPraefix(t._index,e));let i=[];ft.map((t,e)=>{i[e]=ft[getPraefix(e)]}),n(29,ft=i),n(15,ut=o.map((t,e)=>(delete t._index,t))),Ot=!1},t=>e=>{if(!Mt(t))return!1;e.dataTransfer.effectAllowed="move",e.dataTransfer.dropEffect="move",e.dataTransfer.setData(dragId,t+";"+_.name),Ot=t},t=>e=>{const r=Pt(e.dataTransfer.getData(dragId),t)||Ot;return!1===r||r===t?n(30,pt=!1):void n(30,pt={top:r>t&&t,bottom:r<t&&t})},t=>t.preventDefault(),t=>t=>{n(30,pt=!1)},(t,e)=>r=>{setTimeout(()=>{Array.from(Z).forEach(([e,r])=>{ut[t][e]||n(15,ut[t][e]=r._id,ut)})},500);const o=new Set;for(const t of gt)o.add(t.refObj||Y);for(const e of Array.from(o))At(t,e);e(r),Bt(t)},t=>({detail:e})=>{Tt(t,e.item.name)},t=>async({detail:e})=>{const{itemName:r,itemType:o,source:i,target:a,sourceId:s,prop:c}=e;if(!s)return void n(15,ut[t][r]="",ut);let l=await getTaskFull(i,s);const d=l[c];l=await getTaskFull(_.name,$[_.name][t][_.name]);const u=l[a];let h="number"===o?0:"",m=0;u.forEach(t=>{const e=t[c];e.length<=m||e.every(t=>d.find(e=>e===t))&&(h=t[r],m=e.length)}),n(15,ut[t][r]=h,ut)},t=>t?.description||"Daten übernehmen",Ht,Ut,()=>{J=!0,n(23,K="")},(t,e=!1)=>e?(zt(),""):w.find(e=>e.name===t)?.designation||"",zt,()=>{const{refItem:t}=W,e={[t]:nt};let r;w.filter(t=>t.properties?.reader).forEach(t=>{const n=document.getElementById("reader_"+t.name);n&&(e[t.name]=n.value||("number"===t.type?0:""))});let o=ut;const i=o.findIndex(e=>e[t]===nt);i>=0?(r=o[i],o[i]={...r,...e}):o=o.slice(0,-1).concat(e),n(15,ut=o),w.filter(t=>t.properties?.reader).forEach(t=>{bt(t,i>=0?i:0)({detail:{oldValue:r?r[t.name]:"",value:e[t.name]}})}),it=!0,zt()},()=>{it&&(f("readerSave"),it=!1)},()=>{const t=new Map;dt.forEach(e=>{[].concat(e.properties.transfer.target).forEach(n=>{t.set(n,e.name)})});let e=0;for(const r of ut){for(const[o,i]of t)!r[o]&&r[i]&&n(15,ut[e][o]=r[i],ut);e++}n(16,r=ut)},(t,e)=>r=>{const{data:o}=r;"0123456789".includes(o)&&(J?(n(23,K=o.toString()),J=!1):(n(23,K+=o.toString()),"77"===K&&n(23,K="7"),K.length===t&&Ut({detail:{text:K,item:e}})))},g,w,E,z,function(t){H=t,n(14,H)},function(t){L=t,n(17,L)},function(t){B=t,n(13,B)},function(e){bubble(t,e)},function(t){rt=t,n(27,rt)},function(t){X=t,n(22,X)}]}class InputList extends SvelteComponent{constructor(t){super(),document_1$1.getElementById("svelte-9vv5ub-style")||add_css$1(),init(this,t,instance$2,create_fragment$2,safe_not_equal,{list:4,mainSchema:79,schema:80,record:0,multiValues:5,classId:6,eventId:7,disabled:1,fixed:2,template:81,reqQuantity:3,open:12,currency:8,notifyList:9,shortEdit:10,dateInput:11},[-1,-1,-1,-1,-1,-1])}}const{Boolean:Boolean_1,document:document_1}=globals;function add_css(){var t=element("style");t.id="svelte-lfqa43-style",t.textContent="form.disabled.svelte-lfqa43 input.svelte-lfqa43{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-lfqa43.svelte-lfqa43{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-lfqa43.svelte-lfqa43{min-width:30em}}.fEmbedded.svelte-lfqa43.svelte-lfqa43,.fTask.svelte-lfqa43.svelte-lfqa43{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-lfqa43.svelte-lfqa43{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-lfqa43.svelte-lfqa43{height:fit-content;max-height:70vh}.sTask.svelte-lfqa43.svelte-lfqa43{height:95%;display:inline-grid}.sTask.svelte-lfqa43 .btn.svelte-lfqa43{display:initial !important}.form--buttons.svelte-lfqa43.svelte-lfqa43{display:flex;gap:1em;padding-top:0.75em}.flex_div.svelte-lfqa43.svelte-lfqa43{display:flex;margin-top:1em;gap:0.5em;justify-content:space-between}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}section.data + .modal-overlay > .dialog{margin-top:-5em}",append(document_1.head,t)}function get_each_context(t,e,n){const r=t.slice();return r[203]=e[n],r[205]=n,r}function get_each_context_1(t,e,n){const r=t.slice();return r[207]=e[n],r}function get_each_context_2(t,e,n){const r=t.slice();return r[210]=e[n],r}function create_catch_block(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block(t){let e,n,r=t[206]&&create_if_block_5(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,e){t[206]&&r.p(t,e)},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_5(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$=t[23]&&create_if_block_23(t),y=t[40]&&create_if_block_22(t),b=t[0].items,v=[];for(let e=0;e<b.length;e+=1)v[e]=create_each_block_2(get_each_context_2(t,b,e));const I=t=>transition_out(v[t],1,1,()=>{v[t]=null});let C=t[0].list&&create_if_block_16(t),E=!t[4]&&!t[2]&&t[38]&&t[5]&&!t[43]&&create_if_block_15(t);h=new t[48]({props:{outline:!0,$$slots:{default:[create_default_slot_24]},$$scope:{ctx:t}}}),h.$on("click",t[68]);const A=[create_if_block_6,create_if_block_8],S=[];function k(t,e){return t[11]?0:t[38]?1:-1}return~(f=k(t))&&(p=S[f]=A[f](t)),{c(){e=element("section"),$&&$.c(),n=space(),y&&y.c(),r=space(),o=element("form"),i=element("input"),s=space();for(let t=0;t<v.length;t+=1)v[t].c();c=space(),C&&C.c(),l=space(),E&&E.c(),d=space(),u=element("div"),create_component(h.$$.fragment),m=space(),p&&p.c(),attr(i,"class",null_to_empty(t[55])+" svelte-lfqa43"),attr(i,"name","_id"),attr(i,"type","hidden"),i.value=a=t[10]._id||"",attr(o,"class",null_to_empty(t[56])+" svelte-lfqa43"),attr(o,"id",t[55]),attr(u,"class","form--buttons svelte-lfqa43"),attr(e,"class",null_to_empty(t[57])+" svelte-lfqa43")},m(a,p){insert(a,e,p),$&&$.m(e,null),append(e,n),y&&y.m(e,null),append(e,r),append(e,o),append(o,i),append(o,s);for(let t=0;t<v.length;t+=1)v[t].m(o,null);append(o,c),C&&C.m(o,null),append(e,l),E&&E.m(e,null),append(e,d),append(e,u),mount_component(h,u,null),append(u,m),~f&&S[f].m(u,null),_=!0,g||(w=[listen(o,"keydown",t[73]),listen(o,"submit",prevent_default(t[67]))],g=!0)},p(t,s){if(t[23]?$?($.p(t,s),8388608&s[0]&&transition_in($,1)):($=create_if_block_23(t),$.c(),transition_in($,1),$.m(e,n)):$&&(group_outros(),transition_out($,1,1,()=>{$=null}),check_outros()),t[40]?y?(y.p(t,s),512&s[1]&&transition_in(y,1)):(y=create_if_block_22(t),y.c(),transition_in(y,1),y.m(e,r)):y&&(group_outros(),transition_out(y,1,1,()=>{y=null}),check_outros()),(!_||1024&s[0]&&a!==(a=t[10]._id||""))&&(i.value=a),1074861057&s[0]|553652226&s[1]|2033544&s[2]){let e;for(b=t[0].items,e=0;e<b.length;e+=1){const n=get_each_context_2(t,b,e);v[e]?(v[e].p(n,s),transition_in(v[e],1)):(v[e]=create_each_block_2(n),v[e].c(),transition_in(v[e],1),v[e].m(o,c))}for(group_outros(),e=b.length;e<v.length;e+=1)I(e);check_outros()}t[0].list?C?(C.p(t,s),1&s[0]&&transition_in(C,1)):(C=create_if_block_16(t),C.c(),transition_in(C,1),C.m(o,null)):C&&(group_outros(),transition_out(C,1,1,()=>{C=null}),check_outros()),t[4]||t[2]||!t[38]||!t[5]||t[43]?E&&(group_outros(),transition_out(E,1,1,()=>{E=null}),check_outros()):E?(E.p(t,s),52&s[0]|4224&s[1]&&transition_in(E,1)):(E=create_if_block_15(t),E.c(),transition_in(E,1),E.m(e,d));const l={};134217728&s[6]&&(l.$$scope={dirty:s,ctx:t}),h.$set(l);let m=f;f=k(t),f===m?~f&&S[f].p(t,s):(p&&(group_outros(),transition_out(S[m],1,1,()=>{S[m]=null}),check_outros()),~f?(p=S[f],p?p.p(t,s):(p=S[f]=A[f](t),p.c()),transition_in(p,1),p.m(u,null)):p=null)},i(t){if(!_){transition_in($),transition_in(y);for(let t=0;t<b.length;t+=1)transition_in(v[t]);transition_in(C),transition_in(E),transition_in(h.$$.fragment,t),transition_in(p),_=!0}},o(t){transition_out($),transition_out(y),v=v.filter(Boolean_1);for(let t=0;t<v.length;t+=1)transition_out(v[t]);transition_out(C),transition_out(E),transition_out(h.$$.fragment,t),transition_out(p),_=!1},d(t){t&&detach(e),$&&$.d(),y&&y.d(),destroy_each(v,t),C&&C.d(),E&&E.d(),destroy_component(h),~f&&S[f].d(),g=!1,run_all(w)}}}function create_if_block_23(t){let e,n;return e=new t[48]({props:{disabled:t[43]||t[10]._id,filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_30]},$$scope:{ctx:t}}}),e.$on("click",t[90]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1024&n[0]|4096&n[1]&&(r.disabled=t[43]||t[10]._id),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_30(t){let e,n,r;return n=new CameraIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="QR Code scannen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_22(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_29]},$$scope:{ctx:t}}}),e.$on("click",t[88]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_29(t){let e,n,r;return n=new FilePlusIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Dokument ergänzen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_21(t){let e,n;return e=new InputFormField({props:{classId:t[55],item:t[210],selection:t[210].selection,record:t[10],disabled:t[43],eventId:t[65],multiValues:t[60],notifyList:t[12],toDelete:t[20],currency:t[16],changeValue:t[32],initFinished:t[30]}}),e.$on("save",t[72]),e.$on("task",t[69]),e.$on("notify",t[70]),e.$on("safeReference",t[79]),e.$on("multi",t[71]),e.$on("defPrep",t[78]),e.$on("record",t[80]),e.$on("objRecord",t[81]),e.$on("formula",t[82]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[0]&&(r.item=t[210]),1&n[0]&&(r.selection=t[210].selection),1024&n[0]&&(r.record=t[10]),4096&n[1]&&(r.disabled=t[43]),4096&n[0]&&(r.notifyList=t[12]),1048576&n[0]&&(r.toDelete=t[20]),65536&n[0]&&(r.currency=t[16]),2&n[1]&&(r.changeValue=t[32]),1073741824&n[0]&&(r.initFinished=t[30]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_2(t){let e,n,r="list"!==t[210].type&&create_if_block_21(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){"list"!==t[210].type?r?(r.p(t,n),1&n[0]&&transition_in(r,1)):(r=create_if_block_21(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_16(t){let e,n,r,o,i,a=t[7]&&t[61]&&t[17]&&0!=t[17]&&create_if_block_20(t),s=t[18]&&create_if_block_19(t),c=t[62]&&t[31]&&0!=t[31]&&create_if_block_18(t),l=t[0].list,d=[];for(let e=0;e<l.length;e+=1)d[e]=create_each_block_1(get_each_context_1(t,l,e));const u=t=>transition_out(d[t],1,1,()=>{d[t]=null});return{c(){a&&a.c(),e=space(),s&&s.c(),n=space(),c&&c.c(),r=space();for(let t=0;t<d.length;t+=1)d[t].c();o=empty()},m(t,l){a&&a.m(t,l),insert(t,e,l),s&&s.m(t,l),insert(t,n,l),c&&c.m(t,l),insert(t,r,l);for(let e=0;e<d.length;e+=1)d[e].m(t,l);insert(t,o,l),i=!0},p(t,i){if(t[7]&&t[61]&&t[17]&&0!=t[17]?a?(a.p(t,i),131200&i[0]&&transition_in(a,1)):(a=create_if_block_20(t),a.c(),transition_in(a,1),a.m(e.parentNode,e)):a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()),t[18]?s?(s.p(t,i),262144&i[0]&&transition_in(s,1)):(s=create_if_block_19(t),s.c(),transition_in(s,1),s.m(n.parentNode,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),t[62]&&t[31]&&0!=t[31]?c?(c.p(t,i),1&i[1]&&transition_in(c,1)):(c=create_if_block_18(t),c.c(),transition_in(c,1),c.m(r.parentNode,r)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros()),6411333&i[0]|553652236&i[1]|134480904&i[2]){let e;for(l=t[0].list,e=0;e<l.length;e+=1){const n=get_each_context_1(t,l,e);d[e]?(d[e].p(n,i),transition_in(d[e],1)):(d[e]=create_each_block_1(n),d[e].c(),transition_in(d[e],1),d[e].m(o.parentNode,o))}for(group_outros(),e=l.length;e<d.length;e+=1)u(e);check_outros()}},i(t){if(!i){transition_in(a),transition_in(s),transition_in(c);for(let t=0;t<l.length;t+=1)transition_in(d[t]);i=!0}},o(t){transition_out(a),transition_out(s),transition_out(c),d=d.filter(Boolean_1);for(let t=0;t<d.length;t+=1)transition_out(d[t]);i=!1},d(t){a&&a.d(t),t&&detach(e),s&&s.d(t),t&&detach(n),c&&c.d(t),t&&detach(r),destroy_each(d,t),t&&detach(o)}}}function create_if_block_20(t){let e,n;return e=new t[49]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[create_default_slot_28]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};196608&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_28(t){let e,n,r;function o(e){t[105](e)}let i={item:t[58],disabled:!0,currency:t[16]};return void 0!==t[17]&&(i.value=t[17]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};65536&r[0]&&(o.currency=t[16]),!n&&131072&r[0]&&(n=!0,o.value=t[17],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_19(t){let e,n;return e=new t[49]({props:{name:"Total MWSt "+(t[19]?"("+t[19]+"%)":""),nameClass:"formField_italic",$$slots:{default:[create_default_slot_27]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};524288&n[0]&&(r.name="Total MWSt "+(t[19]?"("+t[19]+"%)":"")),327680&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_27(t){let e,n,r;function o(e){t[106](e)}let i={item:t[59],disabled:!0,currency:t[16]};return void 0!==t[18]&&(i.value=t[18]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};65536&r[0]&&(o.currency=t[16]),!n&&262144&r[0]&&(n=!0,o.value=t[18],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_18(t){let e,n;return e=new t[49]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[create_default_slot_26]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[1]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_26(t){let e,n,r;function o(e){t[107](e)}let i={item:t[63],disabled:!0};return void 0!==t[31]&&(i.value=t[31]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};!n&&1&r[1]&&(n=!0,o.value=t[31],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_else_block_2(t){let e,n,r,o;return e=new t[47]({props:{text:t[207].designation}}),r=new InputObject({props:{classId:t[55],open:!t[2]&&1===t[0].list.length,list:t[207],template:t[33],eventId:t[65],schema:t[207].item,record:t[10],disabled:t[43],currency:t[16],update:t[14]}}),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};1&n[0]&&(o.text=t[207].designation),e.$set(o);const i={};5&n[0]&&(i.open=!t[2]&&1===t[0].list.length),1&n[0]&&(i.list=t[207]),4&n[1]&&(i.template=t[33]),1&n[0]&&(i.schema=t[207].item),1024&n[0]&&(i.record=t[10]),4096&n[1]&&(i.disabled=t[43]),65536&n[0]&&(i.currency=t[16]),16384&n[0]&&(i.update=t[14]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_if_block_17(t){let e,n;return e=new InputList({props:{classId:t[55],open:t[22],list:t[207],template:t[34],eventId:t[65],schema:t[207].item,mainSchema:t[0].items,record:t[10],disabled:t[43],fixed:t[207].fixed,reqQuantity:t[21],currency:t[16],notifyList:t[12],multiValues:t[60],shortEdit:t[6],dateInput:t[15]}}),e.$on("save",t[72]),e.$on("record",t[80]),e.$on("readerSave",t[89]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4194304&n[0]&&(r.open=t[22]),1&n[0]&&(r.list=t[207]),8&n[1]&&(r.template=t[34]),1&n[0]&&(r.schema=t[207].item),1&n[0]&&(r.mainSchema=t[0].items),1024&n[0]&&(r.record=t[10]),4096&n[1]&&(r.disabled=t[43]),1&n[0]&&(r.fixed=t[207].fixed),2097152&n[0]&&(r.reqQuantity=t[21]),65536&n[0]&&(r.currency=t[16]),4096&n[0]&&(r.notifyList=t[12]),64&n[0]&&(r.shortEdit=t[6]),32768&n[0]&&(r.dateInput=t[15]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_1(t){let e,n,r,o;const i=[create_if_block_17,create_else_block_2],a=[];function s(t,e){return"array"===t[207].type?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_if_block_15(t){let e,n,r,o;function i(e){t[108](e)}let a={title:"",$$slots:{default:[create_default_slot_25]},$$scope:{ctx:t}};return void 0!==t[37]&&(a.checked=t[37]),n=new t[50]({props:a}),binding_callbacks.push(()=>bind(n,"checked",i)),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"class","askNext"),set_style(e,"margin-top","1em"),set_style(e,"margin-left","23em")},m(t,r){insert(t,e,r),mount_component(n,e,null),o=!0},p(t,e){const o={};134217728&e[6]&&(o.$$scope={dirty:e,ctx:t}),!r&&64&e[1]&&(r=!0,o.checked=t[37],add_flush_callback(()=>r=!1)),n.$set(o)},i(t){o||(transition_in(n.$$.fragment,t),o=!0)},o(t){transition_out(n.$$.fragment,t),o=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot_25(t){let e;return{c(){e=element("span"),e.textContent="Weiter erfassen",set_style(e,"margin-left",".75em")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_24(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_8(t){let e,n,r,o,i,a=!(t[39]||t[37])&&create_if_block_14(t),s=t[5]&&!t[43]&&create_if_block_13(t),c=t[2]&&t[3]&&create_if_block_12(t),l=t[35]&&create_if_block_9(t);return{c(){a&&a.c(),e=space(),s&&s.c(),n=space(),c&&c.c(),r=space(),l&&l.c(),o=empty()},m(t,d){a&&a.m(t,d),insert(t,e,d),s&&s.m(t,d),insert(t,n,d),c&&c.m(t,d),insert(t,r,d),l&&l.m(t,d),insert(t,o,d),i=!0},p(t,i){t[39]||t[37]?a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()):a?(a.p(t,i),320&i[1]&&transition_in(a,1)):(a=create_if_block_14(t),a.c(),transition_in(a,1),a.m(e.parentNode,e)),t[5]&&!t[43]?s?(s.p(t,i),32&i[0]|4096&i[1]&&transition_in(s,1)):(s=create_if_block_13(t),s.c(),transition_in(s,1),s.m(n.parentNode,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),t[2]&&t[3]?c?(c.p(t,i),12&i[0]&&transition_in(c,1)):(c=create_if_block_12(t),c.c(),transition_in(c,1),c.m(r.parentNode,r)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros()),t[35]?l?(l.p(t,i),16&i[1]&&transition_in(l,1)):(l=create_if_block_9(t),l.c(),transition_in(l,1),l.m(o.parentNode,o)):l&&(group_outros(),transition_out(l,1,1,()=>{l=null}),check_outros())},i(t){i||(transition_in(a),transition_in(s),transition_in(c),transition_in(l),i=!0)},o(t){transition_out(a),transition_out(s),transition_out(c),transition_out(l),i=!1},d(t){a&&a.d(t),t&&detach(e),s&&s.d(t),t&&detach(n),c&&c.d(t),t&&detach(r),l&&l.d(t),t&&detach(o)}}}function create_if_block_6(t){let e,n,r,o;e=new t[48]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[create_default_slot_16]},$$scope:{ctx:t}}}),e.$on("click",t[76]);let i=t[36]&&create_if_block_7(t);return{c(){create_component(e.$$.fragment),n=space(),i&&i.c(),r=empty()},m(t,a){mount_component(e,t,a),insert(t,n,a),i&&i.m(t,a),insert(t,r,a),o=!0},p(t,n){const o={};134217728&n[6]&&(o.$$scope={dirty:n,ctx:t}),e.$set(o),t[36]?i?(i.p(t,n),32&n[1]&&transition_in(i,1)):(i=create_if_block_7(t),i.c(),transition_in(i,1),i.m(r.parentNode,r)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(i),o=!1},d(t){destroy_component(e,t),t&&detach(n),i&&i.d(t),t&&detach(r)}}}function create_if_block_14(t){let e,n;return e=new t[48]({props:{class:"close",disabled:t[43],form:t[55],filled:!0,type:"submit",$$slots:{default:[create_default_slot_23]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n[1]&&(r.disabled=t[43]),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_23(t){let e;return{c(){e=text("Speichern und schliessen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_13(t){let e,n;return e=new t[48]({props:{form:t[55],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[create_default_slot_22]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};256&n[1]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_22(t){let e,n=(t[39]||"Speichern")+"";return{c(){e=text(n)},m(t,n){insert(t,e,n)},p(t,r){256&r[1]&&n!==(n=(t[39]||"Speichern")+"")&&set_data(e,n)},d(t){t&&detach(e)}}}function create_if_block_12(t){let e,n;return e=new t[48]({props:{disabled:t[43],danger:!0,outline:!0,$$slots:{default:[create_default_slot_21]},$$scope:{ctx:t}}}),e.$on("click",t[84]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n[1]&&(r.disabled=t[43]),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_21(t){let e;return{c(){e=text("Löschen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_9(t){let e,n,r,o,i;const a=[create_if_block_11,create_else_block_1],s=[];e=function(t){return t[64]?0:1}(t),n=s[e]=a[e](t);let c=t[36]&&create_if_block_10(t);return{c(){n.c(),r=space(),c&&c.c(),o=empty()},m(t,n){s[e].m(t,n),insert(t,r,n),c&&c.m(t,n),insert(t,o,n),i=!0},p(t,e){n.p(t,e),t[36]?c?(c.p(t,e),32&e[1]&&transition_in(c,1)):(c=create_if_block_10(t),c.c(),transition_in(c,1),c.m(o.parentNode,o)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros())},i(t){i||(transition_in(n),transition_in(c),i=!0)},o(t){transition_out(n),transition_out(c),i=!1},d(t){s[e].d(t),t&&detach(r),c&&c.d(t),t&&detach(o)}}}function create_else_block_1(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[create_default_slot_20]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[74](t[1]))&&t[74](t[1]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};134217728&r[6]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_11(t){let e,n;return e=new PopOver({props:{text:t[64],extended:!0,$$slots:{default:[create_default_slot_18]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_20(t){let e,n,r;return n=new PrinterIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent=`${t[83]()}`,create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_default_slot_19(t){let e,n,r;return n=new PrinterIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent=`${t[83]()}`,create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_default_slot_18(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[create_default_slot_19]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[74](t[1]))&&t[74](t[1]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};134217728&r[6]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_10(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[create_default_slot_17]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[75](t[1]))&&t[75](t[1]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};134217728&r[6]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_17(t){let e,n,r;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Daten",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_default_slot_16(t){let e,n,r;return n=new PrinterIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Erstellen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_7(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[create_default_slot_15]},$$scope:{ctx:t}}}),e.$on("click",t[77]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_15(t){let e,n,r;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Daten",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_pending_block(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_default_slot_14(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_13(t){let e;return{c(){e=text("Ja, bitte löschen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_12(t){let e,n,r,o,i,a,s,c,l;return a=new t[48]({props:{filled:!0,$$slots:{default:[create_default_slot_14]},$$scope:{ctx:t}}}),a.$on("click",t[109]),c=new t[48]({props:{danger:!0,outline:!0,$$slots:{default:[create_default_slot_13]},$$scope:{ctx:t}}}),c.$on("click",t[87]),{c(){e=element("p"),e.textContent="Willst du diese Daten löschen?",n=space(),r=element("p"),r.textContent="Das kann nicht rückgängig gemacht werden.",o=space(),i=element("div"),create_component(a.$$.fragment),s=space(),create_component(c.$$.fragment),attr(i,"class","flex_div svelte-lfqa43")},m(t,d){insert(t,e,d),insert(t,n,d),insert(t,r,d),insert(t,o,d),insert(t,i,d),mount_component(a,i,null),append(i,s),mount_component(c,i,null),l=!0},p(t,e){const n={};134217728&e[6]&&(n.$$scope={dirty:e,ctx:t}),a.$set(n);const r={};134217728&e[6]&&(r.$$scope={dirty:e,ctx:t}),c.$set(r)},i(t){l||(transition_in(a.$$.fragment,t),transition_in(c.$$.fragment,t),l=!0)},o(t){transition_out(a.$$.fragment,t),transition_out(c.$$.fragment,t),l=!1},d(t){t&&detach(e),t&&detach(n),t&&detach(r),t&&detach(o),t&&detach(i),destroy_component(a),destroy_component(c)}}}function create_title_icon_slot_2(t){let e,n,r;return n=new AlertTriangleIcon({props:{size:"25"}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"slot","title-icon")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot_11(t){let e,n;return e=new t[46]({props:{title:"Bestätigung",closeCallback:t[202],danger:!0,$$slots:{"title-icon":[create_title_icon_slot_2],default:[create_default_slot_12]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};65536&n[6]&&(r.closeCallback=t[202]),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block(t){let e,n,r;function o(e){t[112](e)}let i={$$slots:{default:[create_default_slot_7,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};return void 0!==t[24]&&(i.open=t[24]),e=new t[45]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};1048576e3&r[0]|134283264&r[6]&&(o.$$scope={dirty:r,ctx:t}),!n&&16777216&r[0]&&(n=!0,o.open=t[24],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_4(t){let e,n,r,o,i,a=t[93](t[23].refItem,!0)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" nicht gefunden!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){8388608&e[0]&&a!==(a=t[93](t[23].refItem,!0)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_3(t){let e,n,r,o,i,a=t[93](t[23].refItem)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" bereits eingefügt!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){8388608&e[0]&&a!==(a=t[93](t[23].refItem)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_1(t){let e;let n=function(t){return"number"===t[203].type?create_if_block_2:create_else_block}(t),r=n(t);return{c(){r.c(),e=empty()},m(t,n){r.m(t,n),insert(t,e,n)},p(t,e){r.p(t,e)},d(t){r.d(t),t&&detach(e)}}}function create_else_block(t){let e;return{c(){e=element("input"),attr(e,"id","reader_"+t[203].name),attr(e,"type","text")},m(t,n){insert(t,e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block_2(t){let e;return{c(){e=element("input"),set_style(e,"width","4em"),attr(e,"id","reader_"+t[203].name),attr(e,"type","number"),attr(e,"min","0")},m(t,n){insert(t,e,n)},p:noop,d(t){t&&detach(e)}}}function create_each_block(t){let e,n,r,o,i,a,s=t[93](t[203].name)+"",c=t[25]&&t[26]&&create_if_block_1(t);return{c(){e=element("tr"),n=element("th"),r=text(s),o=space(),i=element("td"),c&&c.c(),a=space()},m(t,s){insert(t,e,s),append(e,n),append(n,r),append(e,o),append(e,i),c&&c.m(i,null),append(e,a)},p(t,e){t[25]&&t[26]?c?c.p(t,e):(c=create_if_block_1(t),c.c(),c.m(i,null)):c&&(c.d(1),c=null)},d(t){t&&detach(e),c&&c.d()}}}function create_default_slot_10(t){let e;return{c(){e=text("Verwerfen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_9(t){let e;return{c(){e=text("Speichern")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_8(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$,y,b,v,I,C,E,A=t[93](t[23].refItem)+"";function S(e){t[111](e)}let k={keyboard:t[23].keyboard,codeTypes:t[23].codeTypes};function T(t,e){return t[29]?create_if_block_3:t[25]&&!t[27]?create_if_block_4:void 0}void 0!==t[28]&&(k.readerInit=t[28]),e=new InputReader({props:k}),binding_callbacks.push(()=>bind(e,"readerInit",S)),e.$on("scan",t[91]),e.$on("exit",t[96]);let R=T(t),N=R&&R(t),D=t[92](),x=[];for(let e=0;e<D.length;e+=1)x[e]=create_each_block(get_each_context(t,D,e));return v=new t[48]({props:{disabled:!t[25],outline:!0,style:"float: left;",$$slots:{default:[create_default_slot_10]},$$scope:{ctx:t}}}),v.$on("click",t[94]),C=new t[48]({props:{disabled:!t[27],filled:!0,style:"float: right;",$$slots:{default:[create_default_slot_9]},$$scope:{ctx:t}}}),C.$on("click",t[95]),{c(){create_component(e.$$.fragment),r=space(),o=element("div"),i=element("table"),a=element("tr"),s=element("th"),s.textContent="Code",c=space(),l=element("td"),d=text(t[25]),u=space(),h=element("tr"),m=element("th"),f=text(A),p=space(),_=element("td"),g=element("div"),w=text(t[26]),$=space(),N&&N.c(),y=space();for(let t=0;t<x.length;t+=1)x[t].c();b=space(),create_component(v.$$.fragment),I=space(),create_component(C.$$.fragment),set_style(g,"max-width","14em"),set_style(i,"margin-top","1em"),set_style(i,"margin-bottom","1em"),set_style(i,"text-align","left"),set_style(o,"position","relative"),set_style(o,"z-index","1000"),set_style(o,"background-color","white"),set_style(o,"height","225px")},m(t,n){mount_component(e,t,n),insert(t,r,n),insert(t,o,n),append(o,i),append(i,a),append(a,s),append(a,c),append(a,l),append(l,d),append(i,u),append(i,h),append(h,m),append(m,f),append(h,p),append(h,_),append(_,g),append(g,w),append(i,$),N&&N.m(i,null),append(i,y);for(let t=0;t<x.length;t+=1)x[t].m(i,null);append(o,b),mount_component(v,o,null),append(o,I),mount_component(C,o,null),E=!0},p(t,r){const o={};if(8388608&r[0]&&(o.keyboard=t[23].keyboard),8388608&r[0]&&(o.codeTypes=t[23].codeTypes),!n&&268435456&r[0]&&(n=!0,o.readerInit=t[28],add_flush_callback(()=>n=!1)),e.$set(o),(!E||33554432&r[0])&&set_data(d,t[25]),(!E||8388608&r[0])&&A!==(A=t[93](t[23].refItem)+"")&&set_data(f,A),(!E||67108864&r[0])&&set_data(w,t[26]),R===(R=T(t))&&N?N.p(t,r):(N&&N.d(1),N=R&&R(t),N&&(N.c(),N.m(i,y))),100663296&r[0]|1073741824&r[2]|1&r[3]){let e;for(D=t[92](),e=0;e<D.length;e+=1){const n=get_each_context(t,D,e);x[e]?x[e].p(n,r):(x[e]=create_each_block(n),x[e].c(),x[e].m(i,null))}for(;e<x.length;e+=1)x[e].d(1);x.length=D.length}const a={};33554432&r[0]&&(a.disabled=!t[25]),134217728&r[6]&&(a.$$scope={dirty:r,ctx:t}),v.$set(a);const s={};134217728&r[0]&&(s.disabled=!t[27]),134217728&r[6]&&(s.$$scope={dirty:r,ctx:t}),C.$set(s)},i(t){E||(transition_in(e.$$.fragment,t),transition_in(v.$$.fragment,t),transition_in(C.$$.fragment,t),E=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(v.$$.fragment,t),transition_out(C.$$.fragment,t),E=!1},d(t){destroy_component(e,t),t&&detach(r),t&&detach(o),N&&N.d(),destroy_each(x,t),destroy_component(v),destroy_component(C)}}}function create_default_slot_7(t){let e,n;return e=new t[46]({props:{title:"Scannen",class:"reader",closeCallback:t[202],$$slots:{default:[create_default_slot_8]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};65536&n[6]&&(r.closeCallback=t[202]),1048576e3&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_6(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_5(t){let e,n,r,o,i;return o=new t[48]({props:{filled:!0,$$slots:{default:[create_default_slot_6]},$$scope:{ctx:t}}}),o.$on("click",t[113]),{c(){e=element("progress"),n=space(),r=element("div"),create_component(o.$$.fragment),set_style(e,"width","100%"),attr(e,"id","file"),attr(e,"max","100"),e.value=t[42],attr(r,"class","flex_div svelte-lfqa43")},m(t,a){insert(t,e,a),insert(t,n,a),insert(t,r,a),mount_component(o,r,null),i=!0},p(t,n){(!i||2048&n[1])&&(e.value=t[42]);const r={};134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),o.$set(r)},i(t){i||(transition_in(o.$$.fragment,t),i=!0)},o(t){transition_out(o.$$.fragment,t),i=!1},d(t){t&&detach(e),t&&detach(n),t&&detach(r),destroy_component(o)}}}function create_title_icon_slot_1(t){let e,n,r;return n=new AlertTriangleIcon({props:{size:"25"}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"slot","title-icon")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot_4(t){let e,n;return e=new t[46]({props:{title:"Auswertung wird erstellt",closeCallback:t[202],$$slots:{"title-icon":[create_title_icon_slot_1],default:[create_default_slot_5]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};65536&n[6]&&(r.closeCallback=t[202]),2048&n[1]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_3(t){let e,n;return{c(){e=element("p"),n=text(t[9])},m(t,r){insert(t,e,r),append(e,n)},p(t,e){512&e[0]&&set_data(n,t[9])},d(t){t&&detach(e)}}}function create_default_slot_2(t){let e;return{c(){e=text("Schliessen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_1(t){let e,n,r,o,i;return e=new t[51]({props:{outline:!0,$$slots:{default:[create_default_slot_3]},$$scope:{ctx:t}}}),o=new t[48]({props:{danger:!0,outline:!0,$$slots:{default:[create_default_slot_2]},$$scope:{ctx:t}}}),o.$on("click",t[115]),{c(){create_component(e.$$.fragment),n=space(),r=element("div"),create_component(o.$$.fragment),attr(r,"class","flex_div svelte-lfqa43")},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),mount_component(o,r,null),i=!0},p(t,n){const r={};512&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r);const i={};134217728&n[6]&&(i.$$scope={dirty:n,ctx:t}),o.$set(i)},i(t){i||(transition_in(e.$$.fragment,t),transition_in(o.$$.fragment,t),i=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(o.$$.fragment,t),i=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),destroy_component(o)}}}function create_title_icon_slot(t){let e,n,r;return n=new AlertTriangleIcon({props:{size:"25"}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"slot","title-icon")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot$1(t){let e,n;return e=new t[46]({props:{title:"Speichern nicht erfolgreich",danger:!0,$$slots:{"title-icon":[create_title_icon_slot],default:[create_default_slot_1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$1(t){let e,n,r,o,i,a,s,c,l,d,u,h,m;document_1.title=e=t[44];let f={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block,then:create_then_block,catch:create_catch_block,value:206,blocks:[,,,]};function p(e){t[110](e)}handle_promise(t[66](),f);let _={$$slots:{default:[create_default_slot_11,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};void 0!==t[13]&&(_.open=t[13]),o=new t[45]({props:_}),binding_callbacks.push(()=>bind(o,"open",p));let g=t[23]&&t[24]&&create_if_block(t);function w(e){t[114](e)}let $={$$slots:{default:[create_default_slot_4,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};function y(e){t[116](e)}void 0!==t[41]&&($.open=t[41]),c=new t[45]({props:$}),binding_callbacks.push(()=>bind(c,"open",w));let b={$$slots:{default:[create_default_slot$1,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};return void 0!==t[8]&&(b.open=t[8]),u=new t[45]({props:b}),binding_callbacks.push(()=>bind(u,"open",y)),{c(){n=space(),f.block.c(),r=space(),create_component(o.$$.fragment),a=space(),g&&g.c(),s=space(),create_component(c.$$.fragment),d=space(),create_component(u.$$.fragment)},m(t,e){insert(t,n,e),f.block.m(t,f.anchor=e),f.mount=()=>r.parentNode,f.anchor=r,insert(t,r,e),mount_component(o,t,e),insert(t,a,e),g&&g.m(t,e),insert(t,s,e),mount_component(c,t,e),insert(t,d,e),mount_component(u,t,e),m=!0},p(n,r){t=n,(!m||8192&r[1])&&e!==(e=t[44])&&(document_1.title=e),update_await_block_branch(f,t,r);const a={};134283264&r[6]&&(a.$$scope={dirty:r,ctx:t}),!i&&8192&r[0]&&(i=!0,a.open=t[13],add_flush_callback(()=>i=!1)),o.$set(a),t[23]&&t[24]?g?(g.p(t,r),25165824&r[0]&&transition_in(g,1)):(g=create_if_block(t),g.c(),transition_in(g,1),g.m(s.parentNode,s)):g&&(group_outros(),transition_out(g,1,1,()=>{g=null}),check_outros());const d={};2048&r[1]|134283264&r[6]&&(d.$$scope={dirty:r,ctx:t}),!l&&1024&r[1]&&(l=!0,d.open=t[41],add_flush_callback(()=>l=!1)),c.$set(d);const p={};768&r[0]|134217728&r[6]&&(p.$$scope={dirty:r,ctx:t}),!h&&256&r[0]&&(h=!0,p.open=t[8],add_flush_callback(()=>h=!1)),u.$set(p)},i(t){m||(transition_in(f.block),transition_in(o.$$.fragment,t),transition_in(g),transition_in(c.$$.fragment,t),transition_in(u.$$.fragment,t),m=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(f.blocks[t])}transition_out(o.$$.fragment,t),transition_out(g),transition_out(c.$$.fragment,t),transition_out(u.$$.fragment,t),m=!1},d(t){t&&detach(n),f.block.d(t),f.token=null,f=null,t&&detach(r),destroy_component(o,t),t&&detach(a),g&&g.d(t),t&&detach(s),destroy_component(c,t),t&&detach(d),destroy_component(u,t)}}}let gList=new Map,gTask=new Map,gTaskFull=new Map;const setList=(t,e)=>gList.set(t,e),getList2=t=>gList.get(t),getList=async(t,e)=>{const n="p$"+t+"$"+e,r=gList.get(n);if(r?.length)return r;const o=e;return gList.has(o)||(gList.set(o,[]),gList.set(o,Request.getTasksList(e).then(({data:t})=>t))),gList.get(o)},getTask=async(t,e,n,r=!1)=>{let o=gTask.get(n);if(!o)if(r)o=Request.getTaskList(t,n),gTask.set(n,o);else{const r="p$"+t+"$"+e,i=await gList.get(r);if(!i?.length)return getList(t,e).then(e=>(o=e.find(({_id:t})=>t===n),o||(o=Request.getTaskList(t,n)),gTask.set(n,o),o));o=i.find(({_id:t})=>t===n),o||(o=Request.getTaskList(t,n)),gTask.set(n,o)}return o},addTask=(t,e,n)=>{if(!gList.get(t))return;const r=e;gTask.set(r,n)},setTaskSelection=(t,e)=>{gTaskFull.set(t,e)},getTaskSelection=t=>gTaskFull.get(t),getTaskFull=(t,e,n=!1)=>{let r=!n&&gTaskFull.get(e);return r||(r=Request.getTask(t,e),gTaskFull.set(e,r)),r},refreshList=(t,e)=>{if(!gList.get(e))return;const n=e;gList.set(n,Request.getTasksList(e).then(({data:t})=>t))},resetCache=()=>{gList=new Map,gTask=new Map,gTaskFull=new Map};function sleep(t){return new Promise(e=>setTimeout(e,t))}function instance$1(t,e,n){let r,o,i,a,s,c,l,d;component_subscribe(t,taskClipboard,t=>n(134,s=t)),component_subscribe(t,settings,t=>n(135,c=t)),component_subscribe(t,currentRoles,t=>n(136,l=t));const{Modal:u,Dialog:h,Divider:m,Button:f,FormField:p,Checkbox:_,Chip:g}=getAttractions,{loggedIn:w,currentTasks:$,environment:y}=user;component_subscribe(t,w,t=>n(137,d=t)),component_subscribe(t,$,t=>n(132,i=t)),component_subscribe(t,y,t=>n(133,a=t)),JSON.parse(Storage.getItem("Locale"));const b=createEventDispatcher();let{schema:v}=e,{recID:I}=e,{deletable:C}=e,{prevEventID:E=!1}=e,{prev:A=!1}=e,{taskId:S=!1}=e,{taskOrg:k}=e,{description:T=""}=e,{root:R=!1}=e,{readonly:N}=e,{isStandalone:D}=e,{shortEdit:x=!1}=e,{shortSchema:O=!1}=e,M=!0,P=!1,B="",F=window.location.href.split("/task/")[2];F&&(F=F.split(":")[1],F&&(F=F.split("?")[0])),x&&(v=O);let L,q,V,H,U,z,W={},j={},G="form-"+v.class+Math.floor(9e3*Math.random()+1e3).toString(),X=!1,Q=!1;const Y=R?"fEmbedded":"fTask",Z=R?"sEmbedded":"sTask";let K="CHF";const J=new Map;let tt,et,nt=0,rt=0,ot=0,it=0,at=1,st=!I&&v.list&&1===v.list.length;const ct={},lt=v.items.find(t=>"price"===t.name&&!t.properties?.hidden),dt=v.items.find(t=>"quantity"===t.name&&!t.properties?.hidden),ut=v.items.find(t=>"amount"===t.name&&!t.properties?.hidden),ht=!!lt||!!ut,mt=v.list?.filter(t=>"array"===t.type)?.length>1||v.items?.filter(t=>t.name.startsWith("amount"))||ht,ft=v.items.find(t=>"number"===t.type&&"w"===t.properties?.unit?.constant?.toLowerCase()&&!t.properties?.hidden)?.name,pt=!!ft,_t=v.list?.filter(t=>"array"===t.type)?.length>1||pt,gt={},wt=v.result?.resultDef[0].button?.description;let $t,yt,bt,vt,It,Ct,Et,At,St,kt,Tt,Rt,Nt,Dt="",xt="",Ot="",Mt=!1,Pt=!1,Bt=!1,Ft=!1,Lt=!1,qt=0,Vt=0,Ht=[],Ut=[],zt=[],Wt={},jt=new Map,Gt=v.class,Xt=v.id,Qt=!1,Yt=-1!==window.location.search.indexOf("next="),Zt=0;const Kt=-1!==window.location.search.indexOf("back=true");St=At=!i?.length||i.find(t=>t===Xt);["readonly","hidden","required"].map(t=>{v.items.filter(e=>"object"==typeof(e.properties&&e.properties[t])).map(e=>{const n=e.properties[t].refItem||"",[r,o]=n.split(".");Ht.push({action:t,itemName:e.name,refObj:r,refName:o,op:e.properties[t].invert?"!":""})})});v.items.filter(t=>t.selection&&t.constraint).map(t=>{Ut.push({name:t.name,selection:t.selection,constraint:t.constraint})});v.items.filter(t=>t.lookup).forEach(t=>{zt.push({name:t.name,lookup:t.lookup})}),v.items.filter(t=>t.properties?.lookup).forEach(t=>{zt.push({name:t.name,lookup:t.properties.lookup.split(":").at(-1)})});const Jt=async t=>{if(t?.length)for(const e of t){if(!e.lookup)break;const{name:t}=e;if(W[t])break;const{domain:r,value:o}=e.lookup;if("user"===r&&o){const e=d.user,r={[o]:e},i=await Request.getSectionView(t,r);if(i?.length){const[{_id:e}]=i;e&&n(10,W[t]=e,W)}}}},te=async t=>{if(!v.input)return;if(!v.input.length)return;if(v.input.length<2)return;const e=!t.input.class[0].name&&t.input.class[0].selection;if(!e)return;const r=t.input.class[1].name,[o,i]=t.input.class[1].destination?.split(".");if(!r||!i)return;const a=v.list?.find(t=>t.name===o);if(!a)return;if(a.filter)return;const s=await Request.getSchemaByClass(e),c=(await Request.getTasks(s.id)).data;if(!c?.length)return;const l=[];for(const t of c)if(t.active??1){const e={};for(const n of a.item)n.name===i?e[n.name]=t._id:t[n.name]&&(e[n.name]=t[n.name]);l.push(e)}l.length&&n(10,W[o]=l,W)},ee=async t=>{if(!v.input)return;if(!v.input.length)return;if(v.input.length>1)return;const e=Ct.input.class[0],{name:n,selection:r,state:o,list:i}=e;n||r&&o&&i&&await ne(r,o,i)},ne=async(t,e,r)=>{const o=(await Request.getEvents()).filter(e=>e.output?.class?.at(0)?.name===t),i={[r]:[]};for(const n of o){let o={event:n._id,status:e};const a=await Request.getSectionView("_task",o);if(a?.length){o={_id:{$in:a.map(t=>t.docId)}};const e=await Request.getSectionView(t,o);for(const n of e){const e=v.list.find(t=>t.name===r);if(e){const o={[t]:n._id.toString()};for(const t of e.item)n[t.name]&&(o[t.name]=n[t.name]);i[r].push(o)}}}}setTimeout(()=>n(10,W={...W,...i}),100)},re=()=>{for(const t of v.items)"boolean"==typeof t.properties?.value&&n(10,W[t.name]=t.properties.value,W),"string"==typeof t.properties?.value&&n(10,W[t.name]=t.properties.value,W),t.properties?.value?.concatenation&&ie(t);oe()},oe=async()=>{for(const t of v.list||[])for(const e of t.item)if(e.refItem&&"array"!==t.type)if("owner"===e.refItem){const r=a.owner;r||set_store_value(y,a.owner=r=(await Request.getSolitaire(e.refItem))[0],a),a.owner||(await Request.getSolitaire(e.refItem))[0],r&&(W[t.name]||n(10,W[t.name]={},W),n(10,W[t.name][e.name]=getData(r,e.refPos||e.name),W))}else if(W[e.refItem]){const r=await Request.getTask(e.refItem,W[e.refItem]);r&&(W[t.name]||n(10,W[t.name]={},W),n(10,W[t.name][e.name]=getData(r,e.refPos||e.name),W))}},ie=async t=>{const e=t.properties.value.concatenation;let r="";for(const t of e)void 0!==t.constant&&(r+=t.constant),"year"===t.variable&&(r+=(new Date).getFullYear()),t.refItemNext&&(r+=await se(t.refItemNext));n(10,W[t.name]=r,W)},ae=async t=>{const e=Ht.filter(e=>e.refObj===t||e.itemName===t);if(e?.length){n(32,Wt={});for(const t of e){const{itemName:e,refObj:r,refName:o,op:i}=t;let{action:a}=t;if(!r)break;let s,c,l=!o&&W[r];const d=W[r];d&&o&&(l=(await getTaskFull(r,d))[o]),Array.isArray(l)&&0===l.length&&(l=!1),"!"===i&&(l=!l),"required"!==a&&"readonly"!==a||(a="required"===a?a:"disabled",setTimeout(()=>{s=`#${G} .form-field.${e} .field #${e}`,c=document.querySelector(s),c&&l&&c.setAttribute(a,""),c&&!l&&c.removeAttribute(a)},0)),"hidden"===a&&(s=`#${G} .form-field.${e}`,c=document.querySelector(s),c?.classList?.toggle("hidden",!!l),l&&n(32,Wt[e]="",Wt))}}},se=async t=>{const[e,n]=t.offset?.split(",")||[0,0],r=+t.base||0,o=+t.step||1;t.type;const i=t.refItem,a=await Request.getLastId(v.class,i);if(!a?.length)return(r+o).toString().padStart(n,"0");let s=a[0][i];+s<r&&(s=r.toString());return((+s?.substring(e,e+n)||r)+o).toString().padStart(n,"0")},ce=(t,e,n,r=!1)=>{const o=n||e.name,i=o.startsWith("_")?o:o.split("_")[0],a=t.find(t=>t.name===i);let s=e.value;if(!a)return s;if(r||"signature"!==a.type&&!a.properties?.multi||W[o]&&!s&&(s=W[o]),"dateRange"===a.type){if(null===s)return;let t=new Date(s);if("Invalid Date"==t)return;return t=`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(t).toISOString()}if(s&&a.type.startsWith("date"))try{return parseDateTime(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if("boolean"===a.type&&(s=!!e.checked),"number"===a.type){const t=a.properties?.decimals||0;try{s=Number(s.replace(",",".")).toFixed(t).toString()}catch{}}if(r&&"date"===a.type&&a.properties?.required&&!s&&W[o]){s=W[o];try{return parseDateTime(s,"%d.%m.%Y").toISOString()}catch{return s}}return s},le=async t=>{n(43,r=!0);const e=t.submitter?.className?.includes("close"),o={_docAsync:t?._docAsync};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map(t=>{if(t.name)if(t.name.includes(".")){const e=t.name.split(".")[0],n=v.items.find(t=>t.name===e);if(n&&"object"===n.type&&n.properties?.multi)o[e]=(o[e]||[]).concat(t.value);else{const[e,n]=t.name.split("."),r=v.list.find(t=>t.name===e);o[t.name]=ce(r.item,t)}}else o[t.name]=ce(v.items,t);else if(t.id){"signature"===v.items.find(e=>e.name===t.id).type&&(t.name=t.id,o[t.name]=ce(v.items,t))}});let i=!1;if(v.list&&v.list.map(t=>{if(t.mandatory){const e=j[t.name]?.filter(t=>!t._delete).length;if(!e||e<2)return void(i=!0)}"array"===t.type&&j[t.name]&&(t.item.forEach(e=>{for(const n of j[t.name])void 0===n[e.name]&&(n[e.name]="boolean"!==e.type&&"")}),o[t.name]=j[t.name].reduce((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce((e,[n,r])=>("_delete"!==n&&(e[n]=ce(t.item,{name:n,value:r,checked:r},"",!0)),e),{})),[]))}),i)return toasts.failed("Bitte Positionen erfassen",3e3),void n(43,r=!1);if(o._event=Xt,o._prevEventId=E,o._taskId=S,H){const t=H.record;for(const e in t)e.includes(".")&&delete t[e];t._event=H.event,t._taskId=H.taskId;const{id:e}=await Request.saveData(H.class,t);o[H.class]||(o[H.class]=e)}if(x)return de(v.class,o),n(43,r=!1),he();const{id:a,task:s,tax:c,error:l,state:d,info:u}=await Request.saveData(v.class,o);if(l?.text){const t=l.field?" in "+l.field+": "+l.value:"";if(n(9,B=`${l.text} ${t}`),n(8,P=!0),!d)return void n(43,r=!1)}if(Rt){const t=new FormData;t.append("title",Rt.fileName),t.append("file",Rt.file),await Request.uploadUserReport(s,t)}u&&!Array.isArray(u)&&u.accepted?u.accepted?.length?toasts.success(`Email versandt an ${u.accepted.join(", ")}, Dateigrösse: ${u.messageSize} Bytes.`,5e3):(n(9,B="Email konnte nicht versandt werden!"),n(8,P=!0)):toasts.success("Die Daten wurden gespeichert.",2e3),n(43,r=!1),n(18,rt=c?._amount||0),n(19,ot=100*(c?._rate||0)||""),ge(),o._id=a;const h=await Request.getTaskList(v.class,a);if(b("choose",{row:h}),e)return n(43,r=!1),he();if(!I){if(Yt){const t=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${Xt}/${Xt}/task?next=${t}`)}return window.singleSpaNavigate(`/task/${Xt}/${s}/task`)}},de=async(t,e)=>{if(!x.lookup)return;const n={};for(const t in e){const r=e[t];Array.isArray(r)||x.lookup.includes(t)&&(n[t]=e[t])}const r=await Request.getSectionView(v.class,n);if(!r?.length)return void await Request.saveData(t,e);let o,i;for(const n of r.toReversed()){if(!(await Request.getTaskByDocId(n._id,!0)).status.startsWith("WaitingForApproval"))continue;i=n;const r=n[x.ref];for(let i=0;i<r.length;i++){o=!0;const a=r[i];for(const t in a)if(x.lookup.includes(t)&&a[t]!=e[x.ref][0][t]){o=!1;break}if(o)return r[i]=e[x.ref][0],n._event=e._event,n._prevEventId=e._prevEventId,n._taskId=e._taskId,void await Request.saveData(t,n)}}if(i){const n=i;n[x.ref].push(e[x.ref][0]),n._event=e._event,n._prevEventId=e._prevEventId,n._taskId=e._taskId,await Request.saveData(t,n)}else await Request.saveData(t,e)},ue=()=>x||V||D||!E?he():window.history.back(),he=()=>Kt?b("back"):D?window.close():R?window.singleSpaNavigate("/"):b("back"),me=async({detail:t})=>{if(Array.isArray(t.value)&&J.set(t.name,t.value),!(v.input?.length&&v.input.length>1))return;if(L?.class!==v.input[0]&&!F)return;let e,{value:r,lookup:o,name:i,view:a}=t;if(!o&&!F)return;if(o&&(e=o.split(":")[0]),a||(e=i,a="_id"),F){if(e=v.input[1],!J?.size||!J.get(t.name)?.length)return void n(10,W[e]=[],W);a=i,r=[F]}const s=await Request.getSectionView(e,{[a]:{$in:r}}),c=s.map(t=>t._id);for(const t of v.input.slice(1)){n(10,W[t]=[],W);const r=await Request.getSchemaByClass(t);r.id;let o=await Request.getTasks(r.id);if(o=o.data.filter(t=>"Ready"===t._task?.status&&(c.includes(t[e])||c.includes(t._id))),o?.length){const{filter:r}=Ct.input.class.find(e=>e.name===t),{refItem:i,value:a}=r||{},c=[];if(o.forEach(t=>{if(r){const n=s.find(n=>n._id===t[e]);n&&n[i]===a&&c.push(t._id)}else c.push(t._id)}),c.length){const e=await Request.getSectionView(t,{_id:{$in:c}});for(const n of e)n[t]=n._id;n(10,W[t]=e,W)}}}},fe=async(t,e,r)=>{if(1===Ct.input?.class?.length){const n=Ct.input.class[0],{name:r,selection:o,state:i,list:a,exclude:s}=n;t===r&&o&&i&&a&&await pe(t,e,o,i,a,s)}if(v.input&&v.input.length>1&&!F){if(v.input[0]!==t)return;const{name:o,source:i,destination:a,selection:s}=Ct.input.class[1];if(i&&a){const r=await getTaskFull(t,e);if(!r)return void n(10,W[a]=[],W);const o=await getTaskFull(s,r[s]);if(!o)return;const c=o[i]||[];return void n(10,W[a]=c,W)}const{recursive:c}=Ct.input.class[1];if(e){let o=await Request.getTaskOptions(`${t}:${e}`,Xt,c);if(r){const t=a.split(".")[1],e=[];o[t].forEach(n=>{W[t]?.find(e=>e[t]===n[t])||e.push(n)}),o={[t]:W[t]?[...W[t],...e]:[...e]}}n(10,W={...W,...o})}else{const t=v.input.slice(1);for(const e of t)n(10,W[e]=[],W)}}for(const t of Ct.output.class[0].item)"date"===t.type&&t.properties?.value?.formula?Ae(t.name):void 0!==t.factor&&n(10,W[t.name]=W[t.name]*t.factor,W);if((async()=>{const t=v.items.find(t=>"textarea"===t.properties?.format&&t.properties?.source);if(t&&!W[t.name]){const e=new Set;let r="";for(const n of t.properties.source){const[t,o,i]=n.split("."),a=W[t];for(const n of a||[]){const a=n[o];if(a&&!e.has(a)){e.add(a);const n=v.list?.find(e=>e.name===t),s=n?.item.find(t=>t.name===o);if(s?.refClass){const t=await getTaskFull(s.refClass,a);t&&t[i]&&(r+=t[i])}}if(r)break}if(r)break}r&&n(10,W[t.name]=r,W)}})(),v.list?.length){let t=At;for(const e of v.list)"array"===e.type&&e.mandatory&&W[e.name]&&!W[e.name].length&&(t=!1);n(38,St=t)}},pe=async(t,e,n,r,o,i)=>{n=[].concat(n);for(const a of n)await _e(t,e,a,r,o,i)},_e=async(t,e,r,o,i,a)=>{let[s,c]=r.split(".");c||(c=r,s=""),i=[].concat(i);const l=s?(await Request.getEvents()).filter(t=>t.output?.class?.at(0)?.name===c):(await Request.getEvents()).filter(t=>t.output?.class?.at(0)?.name===c&&Ct.output?.class?.at(0)?.list?.find(e=>e.name===t.identity.name)),d={};for(const n of l)if(d[n.identity.name]=[],e){let r={event:n._id,status:o};const l=await Request.getSectionView("_task",r);if(l?.length){const o=[];r={_id:{$in:l.map(t=>t.docId)},[t]:e};const u=await Request.getSectionView(c,r);for(const t of u)for(const e of i)if(e.startsWith("$")){const n=e.slice(1),r=[];for(const e of t[n]||[]){const n={...e,[c]:t._id};for(const t in n)!n.quantity&&t.startsWith("quantity")&&(n.quantity=n[t]);n.quantity&&r.push(n)}let o=d[n]||[];o=o.concat(r),d[n]=o}else if(s){let n=!0;if(a){const r=await Request.getSectionView(v.class,{[e+"."+c]:t._id});n=!r?.length}const r={[c]:t._id.toString()};n&&o.push(r)}else for(const n of t[e]||[]){const e={...n,[c]:t._id};for(const t in e)!e.quantity&&t.startsWith("quantity")&&(e.quantity=e[t]);e.quantity&&o.push(e)}s?d[i[0]]=o.length?o:[]:d[n.identity.name]=o.length?o:[]}}else s&&(d[i[0]]=[]);setTimeout(()=>n(10,W={...W,...d}),100)},ge=()=>{let t=0;if(lt){let e=1;dt&&(e=at),t=it*e}ut&&(t=it);let e=0;for(const t in ct)e+=ct[t];let r=0;for(const t of v.items)t.name.startsWith("amount")&&(r+=+W[t.name]);n(17,nt=e+t),W.discount>0&&n(17,nt-=nt*W.discount*.01),n(17,nt+=r)},we=()=>{let t=0;for(const e in gt)t+=gt[e];n(31,qt=t+ +Vt)},$e=({detail:t})=>{j[t.listName]=t.value,mt&&(ct[t.listName]=t.amountValue,ge()),_t&&(gt[t.listName]=t.weeksValue||0,we()),t.addToRecord&&n(12,U=t)};task_notification.subscribe(async t=>{if(!t)return;if(!I)return;const e=await Request.getSchema(t.eventId);if(!e)return;const r=v.list?.find(t=>t.name===e.class);if(!r)return;const o=await Request.getTaskById(t.taskId);addTask(o.event,o.docId,o.data);const i=await Request.getTask(e.class,o.docId),a=W[e.class].filter(t=>t[e.class]==i._id);a?.length&&a.map(t=>{t[e.class]=o.docId}),n(10,W),n(104,q),n(103,L),n(0,v)}),onMount(async()=>{if(resetCache(),await be(),!x)return;const t={...W};let e=t[x.ref][0];for(const t in e)e[t]||(e[t]=x.value[t]);const r={};for(const n in t){const o=t[n];if(Array.isArray(o))for(const t in e){const n=e[t];x.lookup.includes(t)&&(r[x.ref+"."+t]=n)}else x.lookup.includes(n)&&(r[n]=o)}if(x.lookup.includes("date")){const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate()).toISOString();r.date=e}const o=await Request.getSectionView(v.class,r);let i=!1;for(const t of o){if((await Request.getTaskByDocId(t._id,!0)).status.startsWith("WaitingForApproval")){if(i)break;for(const n of t[x.ref]){let t=!0;for(const r in n)if(x.lookup.includes(r)&&n[r]!=e[r]){t=!1;break}if(t){for(const t in n)x.lookup.includes(t)||(e[t]=n[t]);i=!0;break}}}}n(10,W[x.ref][0]=e,W);const a=(x.focus||x.fill.at(-1))+"-0",s=document.getElementById(a);s&&s.focus()});const ye=async()=>{$t&&(yt||(yt=await Request.getEvent(Xt)),n(37,Yt=!0),$t.autostart&&De())},be=async()=>{const t=t=>new Promise(e=>setTimeout(e,t));let e,n=0;for(;!(e=document.getElementById(G)&&!Ft&&!Lt)&&++n<20;)await t(50);e||(e=document.getElementById(G)),e&&(()=>{if(I)return;const t=new Set;for(const e of Ht)t.add(e.refObj||Gt);Array.from(t).forEach(t=>ae(t))})(),ve()},ve=()=>{setTimeout(()=>{Array.from(jt).forEach(([t,e])=>{W[t]||n(10,W[t]=e._id,W)})},350)};onDestroy(()=>{I&&set_store_value(taskClipboard,s={[I]:{record:W,lists:j}},s)});const Ie=()=>{const t={};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map(e=>{if(e.name){const n=v.items.find(t=>t.name===e.name.split(".")[0]);if(n?.properties?.multi){const n=e.name.split(".")[0];t[n]=(t[n]||[]).concat(e.value)}else if(e.name.includes(".")){const[n,r]=e.name.split("."),o=v.list.find(t=>t.name===n);t[e.name]=ce(o.item,e)}else t[e.name]=ce(v.items,e,e.name.split("_")[0])}}),v.list&&v.list.map(e=>{"array"===e.type&&j[e.name]&&(t[e.name]=j[e.name].reduce((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce((t,[n,r])=>("_delete"!==n&&(t[n]=ce(e.item,{name:n,value:r,checked:r},"",!0)),t),{})),[]))});let e=!0;return Object.entries(t).map(([t,n])=>{t=t.split("_")[0];const r=v.items.find(e=>e.name===t);r?.properties?.required&&!n&&(e=!1)}),e&&t},Ce=async t=>{let e;for(n(42,Zt=0),Re();!e&&Nt;){n(42,Zt++,Zt);const r=await Request.progressReport(t);if(e=r?.progressValue,Zt>300)break;await sleep(1e3)}if(Ne(),e){const e="/api/report/list/"+t;window.open(e,"_self","width=1 height=1")}},Ee=(t,e)=>("number"==typeof t&&t||(t=Number(t||0)),t.toFixed(e||0)),Ae=async t=>{if(!t)return;const e=v.items.find(e=>e.name===t),r=e.properties.value.formula,{operator:o,argument:i}=r,a=i.map(t=>W[t.refItem]);let s=0;if("$add"===o){if("date"===e.type)return void n(10,W[t]=await Se(o,i),W);s=a.reduce((t,e)=>+(t||0)+ +(e||0))}if("$subtract"===o&&(s=a.reduce((t,e)=>{t||(t=""),e||(e="");const[n,r]=t.toString().split(":");t=r?(+n+ +r/60).toFixed(2):+(n||0);let[o,i]=e.toString().split(":");return o||(o=0),t-=i?(+o+ +i/60).toFixed(2):+(o||0)})),"$multiply"===o&&(s=a.reduce((t,e)=>+(t||0)*+(e||0))),"$percentMultiply"===o){const[t,e]=a;if(!+t)return;s=+t,+e>0&&(s*=1-e/100)}if("$percentDivide"===o){const[t,e]=a;if(!+t||!+e)return;s=+t/+e*100}n(10,W[t]="$multiply"===o?s?Ee(s,e.properties?.decimals):"":Ee(s,e.properties?.decimals),W)},Se=async(t,e)=>{const[n,r]=e.map(t=>t.refItem||t.value);let o,i;"string"==typeof r&&([o,...i]=r.split("."),0===i.length?(i=o,o=""):i=i.join("."));const s=ke(W[n])||Date.now();let c=i?0:r;if(o){if("owner"===o)a.owner||set_store_value(y,a.owner=await Request.getSectionView("owner",{}),a),c=getData(a.owner,i);else if(W[o]){const t=await getTaskFull(o,W[o]);t&&(c=getData(t,i))}}else c=c||W[i];return addDays(s,c||0)},ke=t=>{if(!t)return;let e,n,r;t.includes("T")?([e,n,r]=t.split("-"),r=r.split("T")[0]):[r,n,e]=t.split(".");return new Date(+e,+n-1,+r).toISOString()},Te=()=>{n(13,X=!1)},Re=()=>{n(41,Nt=!0)},Ne=()=>{n(41,Nt=!1)},De=()=>{n(29,Pt=!1),n(26,xt=""),n(25,Dt=""),n(27,Ot=""),n(24,bt=!0)},xe=()=>{n(25,Dt=""),n(26,xt=""),n(27,Ot=""),n(29,Pt=!1),n(28,Mt=!0),Oe()},Oe=()=>{if(!$t.keyboard)return;const t=document.getElementById("reader_focusId");t&&t.focus()};return t.$$set=t=>{"schema"in t&&n(0,v=t.schema),"recID"in t&&n(2,I=t.recID),"deletable"in t&&n(3,C=t.deletable),"prevEventID"in t&&n(99,E=t.prevEventID),"prev"in t&&n(4,A=t.prev),"taskId"in t&&n(1,S=t.taskId),"taskOrg"in t&&n(100,k=t.taskOrg),"description"in t&&n(97,T=t.description),"root"in t&&n(5,R=t.root),"readonly"in t&&n(98,N=t.readonly),"isStandalone"in t&&n(101,D=t.isStandalone),"shortEdit"in t&&n(6,x=t.shortEdit),"shortSchema"in t&&n(102,O=t.shortSchema)},t.$$.update=()=>{32&t.$$.dirty[3]&&n(43,r=N),1&t.$$.dirty[0]|3072&t.$$.dirty[3]&&q&&L&&(v.items.map(({name:t,type:e,refItem:r,properties:o})=>{if(!1===r)return;const i=L.items.find(e=>e.name===t);if(!i)return;if(e!==i.type)return;const a="_"+t;q[t]?n(10,W[t]=q[t],W):r&&r.startsWith("owner")||o&&o.readonly||n(10,W[t]="",W),q[a]&&n(10,W[a]=q[a],W),n(22,st=!1)}),(()=>{for(const t of v.list||[]){const e=[],r=W[t.name];if(r?.length){for(const n of r){const r=n;for(const e of t.item)if(!1===e.refItem)r[e.name]="boolean"!==e.type&&"";else if(e.refItem)if("date"!==e.type||W[e.refItem])r[e.name]=W[e.refItem];else{const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);r[e.name]=n}e.push(r)}n(10,W[t.name]=e,W)}}})()),32&t.$$.dirty[0]|16&t.$$.dirty[3]&&n(44,o=R?T||"enablerr - Form":document.title)},[v,S,I,C,A,R,x,M,P,B,W,V,U,X,Q,z,K,nt,rt,ot,tt,et,st,$t,bt,Dt,xt,Ot,Mt,Pt,Ft,qt,Wt,vt,It,Qt,Et,Yt,St,kt,Tt,Nt,Zt,r,o,u,h,m,f,p,_,g,w,$,y,G,Y,Z,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},J,mt,_t,{name:"weekValue",properties:{decimals:1}},wt,Xt,async()=>{if(n(34,It=[]),a.owner||set_store_value(y,a.owner=await Request.getSectionView("owner",{}),a),a.currency?n(16,K=a.currency.designation):Request.getSectionView("owner",{}).then(t=>{t?.length&&t[0].currency&&getTaskFull("currency",t[0].currency).then(t=>{t&&n(16,K=t.designation)}).catch(t=>console.log("currency not found"))}),W.currency&&getTaskFull("currency",W.currency).then(t=>{t&&n(16,K=t.designation)}).catch(t=>console.log("currency not found")),Ct=await Request.getEvent(Xt),x&&n(10,W[x.ref]=[{...x.value}],W),!I){if(n(33,vt=It),Jt(Ct.input?.class).then(()=>{Lt=!0}),re(),te(Ct),ee(),F){const t=Ct.input.class[0].selection;W[t]||(n(10,W[t]=[F],W),me({detail:{value:[F],name:t}}))}await(async()=>{if(!r&&(yt||(yt=await Request.getEvent(Xt)),n(23,$t=yt.output.class[0].reader),$t&&!$t.keyboard))try{const t=await getCameras();t?.length||n(23,$t=!1)}catch{}})(),ye()}if(I){if(s&&s[I]){const t=s[I],e=t.record;v.items.map(t=>{e[t.name]=ce(v.items,{name:t.name,value:e[t.name],checked:e[t.name]})}),n(10,W=e),v.list&&v.list.map(e=>{"array"===e.type&&t.lists[e.name]&&n(10,W[e.name]=t.lists[e.name].reduce((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce((t,[n,r])=>("_delete"!==n&&(t[n]=ce(e.item,{name:n,value:r,checked:r},"",!0)),t),{})),[]),W)})}else n(10,W=await Request.getTask(v.class,I));if(n(97,T=getRecordDescription(v,W)),v.result,n(35,Qt=!!v.result?.resultDef&&!v.result.resultDef[0].createAfterSave),n(18,rt=W._tax?._amount),n(19,ot=100*W._tax?._rate||""),n(40,Tt=v.list?.find(t=>t.mandatory)&&Ct.input?.class?.length>1),Tt){(k||await Request.getTaskByDocId(I,!0)).visum&&n(40,Tt=!1)}n(12,U={itemName:v.class,value:I})}if(E){n(98,N=!1),n(103,L=await Request.getSchema(E)),"string"==typeof A&&n(104,q=await Request.getTask(L.class,A));const t=v.items.find(t=>t.refClass===L.class);t&&n(10,W[t.name]=q._id,W)}if(_t&&(Vt=W[ft]||0),Ct.trigger?.startOn&&!Ct.trigger.startOn.some(t=>t.type.indexOf("Manual")>=0)&&n(98,N=!0),c.role?.length&&v.authorization?.length){const t=v.authorization.some(t=>l?.find(e=>e===t.role&&"edit"===t.activity));n(98,N||=!t)}if(n(11,V="report"===Ct.output.type),n(7,M=!1!==Ct.output.class?.at(0)?.documentTotal),n(39,kt=Ct.output.saveButton),a.userSetting){const t=a.userSetting;if(n(36,Et=t.isAdmin),!Et){const t=d.tenants.find(t=>t._id===d.tenant);t&&n(36,Et=t.admin?.find(t=>t===d.user))}}else Request.getUserSettings().then(t=>{if(n(36,Et=t.isAdmin),!Et){const t=d.tenants.find(t=>t._id===d.tenant);t&&n(36,Et=t.admin?.find(t=>t===d.user))}});return n(30,Ft=!0),!0},le,ue,async({detail:t})=>{const{row:e}=t;let{eventId:r}=t;if((()=>{if(I)for(const t of Ht)t.refName||ae(t.itemName)})(),await(async(t,e)=>{if(!t&&!e?._id)return;let r,o=!1;const i={...W};for(const n of v.items){if("string"==typeof n.refItem&&(!t||n.properties?.linkOnly)){const[t,s]=n.refItem.split(".");if("owner"===t)n.refItem.split(".").length<3&&(i[n.name]=a.owner[s||n.refClass],o=!0);else if(n.refInput?.includes("|")&&W[t]){const[e,a]=n.refInput.split("|");r=await getTaskFull(t,W[t]),i[n.name]=r[e]||r[a]||"",o=!0}else if(W[t]){if((e._id===W[t]||n.refItemAlt)&&(r=await getTaskFull(t,W[t]),r)){let t;24===r[s]?.toString().length?(r=await getTaskFull(s,r[s]),r&&(t=r[n.name||n.refInput])):s?(t=r[s][n.name]||r[s],"object"==typeof t&&(t=void 0)):t=r[n.name],void 0!==t&&(i[n.name]=t,o=!0)}}else s&&(i[n.name]="",o=!0)}if(!i[n.name]&&"string"==typeof n.refItemAlt&&(!t||n.properties?.linkOnly)){const[t,a]=n.refItemAlt.split(".");if((W[t]||e[t])&&(r=await getTaskFull(t,W[t]||e[t]),r)){let t;24===r[a]?.toString().length?(r=await getTaskFull(a,r[a]),r&&(t=r[n.name||n.refInput])):t=a?r[a][n.name]||r[a]:r[n.name],void 0!==t&&(i[n.name]=t,o=!0)}}}for(const e of v.list||[])if((!t||e.properties?.linkOnly)&&e.refItem&&W[e.refItem]){r=await getTaskFull(refItem,W[e.refItem]);const t=[];for(const n of r[e.name]){const r={};for(const t of e.item)n[t.name]&&(r[t.name]=n[t.name]);t.push(r),o=!0}i[e.name]=t}o&&n(10,W=i)})(!!I,e),I)return;if(r||=e._task?.event,r&&(await(async(t,e)=>{if(!t)return;const r=(await Request.getEvent(t)).output.class[0].name,o=zt.filter(t=>t.lookup===r);if(o?.length)for(const t of o){const{lookup:r,name:o}=t;let i="";if(e){let t=await getTaskFull(r,e);t&&t[o]?.length&&(i=t[o][0][o])}i&&n(10,W[o]=i,W)}})(r,e._id),v.items.filter(t=>t.properties?.lookup).forEach(async t=>{const e=await Request.getEvent(r);e.output.class[0]?.name===t.properties.lookup&&n(10,W[t.name]="",W)})),!e._task)return;const o=e._task.event,i=await Request.getEvent(o);for(const t of Ct.output.class[0].item)"date"===t.type&&t.properties?.value?.formula&&Ae(t.name);if(!Ct.output?.class?.length)return;const s=Ct.output.class[0]?.item.find(t=>(t.refClass||t.name)===i.output.class[0]?.name);(Ct.input?.class?.length&&Ct.input.class[0].name===i.output.class[0]?.name||s?.asInput)&&(n(103,L=await Request.getSchema(o)),n(99,E=o),n(1,S=e._task._id),S&&e._task.docId?n(104,q=await Request.getTask(L.class,e._task.docId)):n(104,q={}),await fe(L.class,e?._task?.docId||e?._task?._id))},async({detail:t})=>{if(!x&&(n(12,U=t),"quantity"===t.itemName&&n(21,et=W.quantity),"currency"===t.itemName&&t.value&&getTaskFull("currency",t.value).then(t=>{t&&n(16,K=t.designation)}).catch(t=>console.log("currency not found")),(async(t,e)=>{const r=Ut.filter(e=>e.selection===t||e.constraint===t);if(r?.length){n(20,tt=!1);for(const o of r){const{selection:r,constraint:i,name:a}=o;if(e)break;n(10,W[a]="",W),t===r&&n(20,tt=i);const s=W[r];if(s&&t===i){let t=await getTaskFull(r,s);const e=W[i];if(e?.length){const r=e[0].split(", ");t=t[i];let o="";for(const e of t)Object.values(e).map(t=>{r.includes(t)&&(o=e[a])});n(10,W[a]=o,W)}}}}})(t.itemName,t.oldValue===t.value),oe(),ae(t.itemName),_t&&ft&&(t.itemName===ft&&(Vt=+t.value),we()),ht&&mt)){if(t.itemName===lt?.name)it=t.value;else if(t.itemName===dt?.name)at=t.value;else{if(t.itemName!==ut?.name)return;it=t.value}ge()}},me,$e,t=>{"button"!==t.srcElement?.type&&"textarea"!==t.srcElement?.type&&13==t.which&&t.preventDefault()},t=>async()=>{const e=await Request.getReportDoc(t)||{},{userReportId:n,type:r}=e;if(!n)return;if("eps"===r)return void toasts.success("Die Datei wurde erstellt und im Anhang abgelegt.");const o="/api/userreport/"+n;if("ics"===r)return window.open(o,"_self","width=1 height=1");const i="/viewer/doc/index.html?file="+o+"&type="+r;window.open(i,"","popup=yes toolbar=no width=624 height=900")},t=>async()=>{const t=await Request.getDocData(S);(async t=>{const e=window.screen.height,n=window.open("","_blank","width=800,height="+e+",location=no");await tick(),n?.document.write("<title>Report Daten für '"+v.identity.designation+"'</title>"),n?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+t+"</textarea>")})(JSON.stringify(t,null,4),v.identity.designation)},async()=>{const t=Ie();if(!t)return;const e=Ct.result?.resultDef[0]?.addToReports;if(e){const n=t[e];if(n){const e={docId:n},r=(await Request.getSectionView("_task",e))[0];t._taskId=r._id}}const{reportId:n,type:r}=await Request.createReport(Xt,t);await Ce(n),he()},async()=>{const t=Ie();if(!t)return;const e=await Request.getReportData(Xt,t),n=window.screen.height,r=window.open("","_blank","width=800,height="+n+",location=no");await tick(),r?.document.write("<title>Report Daten für '"+v.identity.designation+"'</title>"),r?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(e,null,4)+"</textarea>")},async({detail:{className:t,itemName:e,value:n}})=>{if(Gt!==n)return;if(!t)return;if(jt.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===Gt)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&jt.set(t,o[0])},({detail:t})=>{H=t},({detail:t})=>{t.target&&v.list?.length?n(15,z={ref:t.target,val:t.value}):t.itemName.startsWith("$")?Rt=t.value:setTimeout(()=>{n(10,W[t.itemName]=t.value,W)},200)},({detail:t})=>{n(14,Q=!1);for(const e of t.items)n(10,W[t.listName][e.name]=e.value,W);n(14,Q=!0)},({detail:t})=>{Ae(t.item.name)},()=>v.result.resultDef[0].button?.designation||"Dokument erstellen",()=>{n(13,X=!0)},Te,Ne,async()=>{if(Gt&&I){(await Request.deleteData(Gt,I)).taskId?(toasts.success("Die Daten wurden gelöscht.",3e3),ue()):toasts.failed("Die Daten können nicht gelöscht werden!",3e3)}Te()},async()=>{if(!Tt)return;const t=Ct.input.class[0].name,e=Ct.input.class[1].destination.split(".")[1];if(!t)return;if(!e)return;if(!W[t])return;const n=W[e]?.length||0;await fe(t,W[t],!0),n<W[e].length?($e({detail:{listName:e,value:W[e]}}),le({})):toasts.failed("Keine Positionen gefunden!",3e3)},()=>{I&&le({_docAsync:!0})},De,async({detail:t})=>{if(n(29,Pt=!1),n(26,xt=""),n(25,Dt=t.text||""),!Dt)return;const e=readSwissQR(Dt);for(const t in e){if(v.items.find(e=>e.name===t))if("object"==typeof e[t]){let r={};for(const o in e[t])if("object"==typeof e[t][o])for(const i in e[t][o]){e[t][o][i]&&(r[i]=e[t][o][i]);const a=await Request.getSectionView(o,r);if(a?.length){const e=await Request.getSectionView(t,{[o]:a[0]._id});e?.length&&n(10,W[t]=e[0]._id,W)}}else{e[t][o]&&(r[o]=e[t][o]);const i=await Request.getSectionView(t,r);i?.length&&n(10,W[t]=i[0]._id,W)}}else e[t]&&n(10,W[t]=e[t],W)}n(24,bt=!1)},()=>v.items.filter(t=>t.properties?.reader),(t,e=!1)=>e?(xe(),""):v.items.find(e=>e.name===t)?.designation||"",xe,()=>{const{refItem:t}=$t,e={[t]:Ot};let n;v.filter(t=>t.properties?.reader).forEach(t=>{const n=document.getElementById("reader_"+t.name);n&&(e[t.name]=n.value||("number"===t.type?0:""))});let r=rec;const o=r.findIndex(e=>e[t]===Ot);o>=0?(n=r[o],r[o]={...n,...e}):r=r.slice(0,-1).concat(e),rec=r,v.filter(t=>t.properties?.reader).forEach(t=>{notify(t,o>=0?o:0)({detail:{oldValue:n?n[t.name]:"",value:e[t.name]}})}),Bt=!0,xe()},()=>{Bt&&(Bt=!1,le({}))},T,N,E,k,D,O,L,q,function(t){nt=t,n(17,nt)},function(t){rt=t,n(18,rt)},function(t){qt=t,n(31,qt)},function(t){Yt=t,n(37,Yt)},()=>Te(),function(t){X=t,n(13,X)},function(t){Mt=t,n(28,Mt)},function(t){bt=t,n(24,bt)},()=>Ne(),function(t){Nt=t,n(41,Nt)},()=>{n(8,P=!1)},function(t){P=t,n(8,P)}]}class Index extends SvelteComponent{constructor(t){super(),document_1.getElementById("svelte-lfqa43-style")||add_css(),init(this,t,instance$1,create_fragment$1,safe_not_equal,{schema:0,recID:2,deletable:3,prevEventID:99,prev:4,taskId:1,taskOrg:100,description:97,root:5,readonly:98,isStandalone:101,shortEdit:6,shortSchema:102},[-1,-1,-1,-1,-1,-1,-1])}}function create_default_slot(t){let e,n,r;function o(e){t[4](e)}let i={schema:t[5],recID:t[6]};return void 0!==t[0]&&(i.description=t[0]),e=new Index({props:i}),binding_callbacks.push(()=>bind(e,"description",o)),e.$on("back",t[2]),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};32&r&&(o.schema=t[5]),64&r&&(o.recID=t[6]),!n&&1&r&&(n=!0,o.description=t[0],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_fragment(t){let e,n;return e=new Page({props:{update:t[1],description:t[0],$$slots:{default:[create_default_slot,({prop:{schema:t,recID:e,eventID:n}})=>({5:t,6:e,7:n}),({prop:t})=>(t?32:0)|(t?64:0)|(t?128:0)]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,[n]){const r={};1&n&&(r.description=t[0]),353&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance(t,e,n){let r,{refresh:o}=e;return t.$$set=t=>{"refresh"in t&&n(3,o=t.refresh)},[r,(t,e)=>Request.getSchema(t).then(n=>({schema:n,recID:e,eventID:t,title:n.identity.designation})),t=>{},o,function(t){r=t,n(0,r)}]}class Detail extends SvelteComponent{constructor(t){super(),init(this,t,instance,create_fragment,safe_not_equal,{refresh:3})}}var singleSpaSvelte_1=createCommonjsModule(function(t,e){function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){o(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("object"!==i(t))throw new Error("single-spa-svelte requires a configuration object");var e=r(r({},a),t);if(!e.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,e,n),mount:c.bind(null,e,n),unmount:l.bind(null,e,n),update:d.bind(null,e,n)}};var a={component:null,domElementGetter:null,props:{}};function s(t){return Promise.resolve()}function c(t,e,n){var o=Object.keys(a),i=Object.keys(t).reduce(function(e,n){return o.includes(n)||(e[n]=t[n]),e},{});return Promise.resolve().then(function(){var o=function(t,e){return(e=e&&e.customProps?e.customProps:e).domElement?function(){return e.domElement}:e.domElementGetter?function(){return e.domElementGetter(e)}:t.domElementGetter?function(){return t.domElementGetter(e)}:function(t){var e=t.appName||t.name;if(!e)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)}(t,n),a=o();e.instance=new t.component(r(r({},i),{},{target:a,props:Object.assign({},n,t.props)}))})}function l(t,e){return Promise.resolve().then(function(){e.instance.$destroy?e.instance.$destroy():e.instance.destroy()})}function d(t,e,n){return Promise.resolve().then(function(){e.instance.$set?e.instance.$set(n):e.instance.set(n)})}}),singleSpaSvelte=getDefaultExportFromCjs(singleSpaSvelte_1);const lcDetail=singleSpaSvelte({component:Detail,domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:bootstrap,mount:mount,unmount:unmount}=lcDetail;exports({bootstrap:bootstrap,mount:mount,unmount:unmount});const Form=exports("Form",Index),List=exports("List",List$1),Template=exports("Template",Template$1)}}});
|
|
9
|
+
*/class Point{constructor(t,e,n,r){if(isNaN(t)||isNaN(e))throw new Error(`Point is invalid: (${t}, ${e})`);this.x=+t,this.y=+e,this.pressure=n||0,this.time=r||Date.now()}distanceTo(t){return Math.sqrt(Math.pow(this.x-t.x,2)+Math.pow(this.y-t.y,2))}equals(t){return this.x===t.x&&this.y===t.y&&this.pressure===t.pressure&&this.time===t.time}velocityFrom(t){return this.time!==t.time?this.distanceTo(t)/(this.time-t.time):0}}class Bezier{static fromPoints(t,e){const n=this.calculateControlPoints(t[0],t[1],t[2]).c2,r=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new Bezier(t[1],n,r,t[2],e.start,e.end)}static calculateControlPoints(t,e,n){const r=t.x-e.x,o=t.y-e.y,i=e.x-n.x,a=e.y-n.y,s=(t.x+e.x)/2,c=(t.y+e.y)/2,l=(e.x+n.x)/2,d=(e.y+n.y)/2,u=Math.sqrt(r*r+o*o),h=Math.sqrt(i*i+a*a),m=u+h==0?0:h/(u+h),f=l+(s-l)*m,p=d+(c-d)*m,_=e.x-f,g=e.y-p;return{c1:new Point(s+_,c+g),c2:new Point(l+_,d+g)}}constructor(t,e,n,r,o,i){this.startPoint=t,this.control2=e,this.control1=n,this.endPoint=r,this.startWidth=o,this.endWidth=i}length(){let t,e,n=0;for(let r=0;r<=10;r+=1){const o=r/10,i=this.point(o,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),a=this.point(o,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(r>0){const r=i-t,o=a-e;n+=Math.sqrt(r*r+o*o)}t=i,e=a}return n}point(t,e,n,r,o){return e*(1-t)*(1-t)*(1-t)+3*n*(1-t)*(1-t)*t+3*r*(1-t)*t*t+o*t*t*t}}class SignatureEventTarget{constructor(){try{this._et=new EventTarget}catch(t){this._et=document}}addEventListener(t,e,n){this._et.addEventListener(t,e,n)}dispatchEvent(t){return this._et.dispatchEvent(t)}removeEventListener(t,e,n){this._et.removeEventListener(t,e,n)}}function throttle(t,e=250){let n,r,o,i=0,a=null;const s=()=>{i=Date.now(),a=null,n=t.apply(r,o),a||(r=null,o=[])};return function(...c){const l=Date.now(),d=e-(l-i);return r=this,o=c,d<=0||d>e?(a&&(clearTimeout(a),a=null),i=l,n=t.apply(r,o),a||(r=null,o=[])):a||(a=window.setTimeout(s,d)),n}}class SignaturePad extends SignatureEventTarget{constructor(t,e={}){var n,r,o;super(),this.canvas=t,this._drawingStroke=!1,this._isEmpty=!0,this._lastPoints=[],this._data=[],this._lastVelocity=0,this._lastWidth=0,this._handleMouseDown=t=>{this._isLeftButtonPressed(t,!0)&&!this._drawingStroke&&this._strokeBegin(this._pointerEventToSignatureEvent(t))},this._handleMouseMove=t=>{this._isLeftButtonPressed(t,!0)&&this._drawingStroke?this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t)):this._strokeEnd(this._pointerEventToSignatureEvent(t),!1)},this._handleMouseUp=t=>{this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))},this._handleTouchStart=t=>{1!==t.targetTouches.length||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))},this._handleTouchMove=t=>{1===t.targetTouches.length&&(t.cancelable&&t.preventDefault(),this._drawingStroke?this._strokeMoveUpdate(this._touchEventToSignatureEvent(t)):this._strokeEnd(this._touchEventToSignatureEvent(t),!1))},this._handleTouchEnd=t=>{0===t.targetTouches.length&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))},this._handlePointerDown=t=>{!t.isPrimary||!this._isLeftButtonPressed(t)||this._drawingStroke||void 0!==this._strokePointerId&&this._strokePointerId!==this._getPointerId(t)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))},this._handlePointerMove=t=>{t.isPrimary&&this._strokePointerId===this._getPointerId(t)&&(this._isLeftButtonPressed(t,!0)&&this._drawingStroke?(t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))):this._strokeEnd(this._pointerEventToSignatureEvent(t),!1))},this._handlePointerUp=t=>{t.isPrimary&&!this._isLeftButtonPressed(t)&&this._strokePointerId===this._getPointerId(t)&&(this._strokePointerId=void 0,t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))},this.velocityFilterWeight=e.velocityFilterWeight||.7,this.minWidth=e.minWidth||.5,this.maxWidth=e.maxWidth||2.5,this.throttle=null!==(n=e.throttle)&&void 0!==n?n:16,this.minDistance=null!==(r=e.minDistance)&&void 0!==r?r:5,this.dotSize=e.dotSize||0,this.penColor=e.penColor||"black",this.backgroundColor=e.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=e.compositeOperation||"source-over",this.canvasContextOptions=null!==(o=e.canvasContextOptions)&&void 0!==o?o:{},this._strokeMoveUpdate=this.throttle?throttle(SignaturePad.prototype._strokeUpdate,this.throttle):SignaturePad.prototype._strokeUpdate,this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}clear(){const{_ctx:t,canvas:e}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,e.width,e.height),t.fillRect(0,0,e.width,e.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0}fromDataURL(t,e={}){return new Promise((n,r)=>{const o=new Image,i=e.ratio||window.devicePixelRatio||1,a=e.width||this.canvas.width/i,s=e.height||this.canvas.height/i,c=e.xOffset||0,l=e.yOffset||0;this._reset(this._getPointGroupOptions()),o.onload=()=>{this._ctx.drawImage(o,c,l,a,s),n()},o.onerror=t=>{r(t)},o.crossOrigin="anonymous",o.src=t,this._isEmpty=!1})}toDataURL(t="image/png",e){return"image/svg+xml"===t?("object"!=typeof e&&(e=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(e))}`):("number"!=typeof e&&(e=void 0),this.canvas.toDataURL(t,e))}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){var t;const e=window.document===this.canvas.ownerDocument?window:null!==(t=this.canvas.ownerDocument.defaultView)&&void 0!==t?t:this.canvas.ownerDocument;return{addEventListener:e.addEventListener.bind(e),removeEventListener:e.removeEventListener.bind(e)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:e=!0}={}){e&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,e){return e?1===t.buttons:!(1&~t.buttons)}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const e=t.changedTouches[0];return{event:t,type:t.type,x:e.clientX,y:e.clientY,pressure:e.force}}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:e}=this._getListenerFunctions();switch(t.event.type){case"mousedown":e("mousemove",this._handleMouseMove,{passive:!1}),e("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":e("touchmove",this._handleTouchMove,{passive:!1}),e("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":e("pointermove",this._handlePointerMove,{passive:!1}),e("pointerup",this._handlePointerUp,{passive:!1})}this._drawingStroke=!0;const n=this._getPointGroupOptions(),r=Object.assign(Object.assign({},n),{points:[]});this._data.push(r),this._reset(n),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(0===this._data.length)return void this._strokeBegin(t);this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const e=this._createPoint(t.x,t.y,t.pressure),n=this._data[this._data.length-1],r=n.points,o=r.length>0&&r[r.length-1],i=!!o&&e.distanceTo(o)<=this.minDistance,a=this._getPointGroupOptions(n);if(!o||!o||!i){const t=this._addPoint(e,a);o?t&&this._drawCurve(t,a):this._drawDot(e,a),r.push({time:e.time,x:e.x,y:e.y,pressure:e.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,e=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(e&&this._strokeUpdate(t),this._drawingStroke=!1,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,e,n){const r=this.canvas.getBoundingClientRect();return new Point(t-r.left,e-r.top,n,(new Date).getTime())}_addPoint(t,e){const{_lastPoints:n}=this;if(n.push(t),n.length>2){3===n.length&&n.unshift(n[0]);const t=this._calculateCurveWidths(n[1],n[2],e),r=Bezier.fromPoints(n,t);return n.shift(),r}return null}_calculateCurveWidths(t,e,n){const r=n.velocityFilterWeight*e.velocityFrom(t)+(1-n.velocityFilterWeight)*this._lastVelocity,o=this._strokeWidth(r,n),i={end:o,start:this._lastWidth};return this._lastVelocity=r,this._lastWidth=o,i}_strokeWidth(t,e){return Math.max(e.maxWidth/(t+1),e.minWidth)}_drawCurveSegment(t,e,n){const r=this._ctx;r.moveTo(t,e),r.arc(t,e,n,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,e){const n=this._ctx,r=t.endWidth-t.startWidth,o=2*Math.ceil(t.length());n.beginPath(),n.fillStyle=e.penColor;for(let n=0;n<o;n+=1){const i=n/o,a=i*i,s=a*i,c=1-i,l=c*c,d=l*c;let u=d*t.startPoint.x;u+=3*l*i*t.control1.x,u+=3*c*a*t.control2.x,u+=s*t.endPoint.x;let h=d*t.startPoint.y;h+=3*l*i*t.control1.y,h+=3*c*a*t.control2.y,h+=s*t.endPoint.y;const m=Math.min(t.startWidth+s*r,e.maxWidth);this._drawCurveSegment(u,h,m)}n.closePath(),n.fill()}_drawDot(t,e){const n=this._ctx,r=e.dotSize>0?e.dotSize:(e.minWidth+e.maxWidth)/2;n.beginPath(),this._drawCurveSegment(t.x,t.y,r),n.closePath(),n.fillStyle=e.penColor,n.fill()}_fromData(t,e,n){for(const r of t){const{points:t}=r,o=this._getPointGroupOptions(r);if(t.length>1)for(let n=0;n<t.length;n+=1){const r=t[n],i=new Point(r.x,r.y,r.pressure,r.time);0===n&&this._reset(o);const a=this._addPoint(i,o);a&&e(a,o)}else this._reset(o),n(t[0],o)}}toSVG({includeBackgroundColor:t=!1}={}){const e=this._data,n=Math.max(window.devicePixelRatio||1,1),r=this.canvas.width/n,o=this.canvas.height/n,i=document.createElementNS("http://www.w3.org/2000/svg","svg");if(i.setAttribute("xmlns","http://www.w3.org/2000/svg"),i.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),i.setAttribute("viewBox",`0 0 ${r} ${o}`),i.setAttribute("width",r.toString()),i.setAttribute("height",o.toString()),t&&this.backgroundColor){const t=document.createElement("rect");t.setAttribute("width","100%"),t.setAttribute("height","100%"),t.setAttribute("fill",this.backgroundColor),i.appendChild(t)}return this._fromData(e,(t,{penColor:e})=>{const n=document.createElement("path");if(!(isNaN(t.control1.x)||isNaN(t.control1.y)||isNaN(t.control2.x)||isNaN(t.control2.y))){const r=`M ${t.startPoint.x.toFixed(3)},${t.startPoint.y.toFixed(3)} C ${t.control1.x.toFixed(3)},${t.control1.y.toFixed(3)} ${t.control2.x.toFixed(3)},${t.control2.y.toFixed(3)} ${t.endPoint.x.toFixed(3)},${t.endPoint.y.toFixed(3)}`;n.setAttribute("d",r),n.setAttribute("stroke-width",(2.25*t.endWidth).toFixed(3)),n.setAttribute("stroke",e),n.setAttribute("fill","none"),n.setAttribute("stroke-linecap","round"),i.appendChild(n)}},(t,{penColor:e,dotSize:n,minWidth:r,maxWidth:o})=>{const a=document.createElement("circle"),s=n>0?n:(r+o)/2;a.setAttribute("r",s.toString()),a.setAttribute("cx",t.x.toString()),a.setAttribute("cy",t.y.toString()),a.setAttribute("fill",e),i.appendChild(a)}),i.outerHTML}}const{document:document_1$2}=globals;function add_css$6(){var t=element("style");t.id="svelte-efkzkz-style",t.textContent=".feather2.svelte-efkzkz{position:absolute;top:0.25em;right:0.25em;color:#4300b0}.wrapper.svelte-efkzkz{position:relative;width:100%;height:200px;-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;border:1px solid #36697d}canvas.svelte-efkzkz{width:100%;height:100%;display:block;background-color:lightyellow}.signature-readonly.svelte-efkzkz{cursor:not-allowed;pointer-events:none}",append(document_1$2.head,t)}function create_if_block$6(t){let e,n,r,o,i;return n=new DeleteIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 pointer svelte-efkzkz")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[5]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$7(t){let e,n,r,o,i,a,s=!t[0]&&create_if_block$6(t);return{c(){e=element("div"),n=element("canvas"),o=space(),s&&s.c(),attr(n,"id",t[1]),attr(n,"name",t[1]),attr(n,"class",r=t[2]+" signature_pad "+t[3]+(t[0]||t[4]?" signature-readonly":"")+" svelte-efkzkz"),attr(e,"class",i=t[2]+"_wrapper wrapper svelte-efkzkz"),attr(e,"id","signature_wrapper")},m(t,r){insert(t,e,r),append(e,n),append(e,o),s&&s.m(e,null),a=!0},p(t,[o]){(!a||2&o)&&attr(n,"id",t[1]),(!a||2&o)&&attr(n,"name",t[1]),(!a||29&o&&r!==(r=t[2]+" signature_pad "+t[3]+(t[0]||t[4]?" signature-readonly":"")+" svelte-efkzkz"))&&attr(n,"class",r),t[0]?s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()):s?(s.p(t,o),1&o&&transition_in(s,1)):(s=create_if_block$6(t),s.c(),transition_in(s,1),s.m(e,null)),(!a||4&o&&i!==(i=t[2]+"_wrapper wrapper svelte-efkzkz"))&&attr(e,"class",i)},i(t){a||(transition_in(s),a=!0)},o(t){transition_out(s),a=!1},d(t){t&&detach(e),s&&s.d()}}}const signatureMap=new Map;let signature="";function instance$7(t,e,n){const r=createEventDispatcher();let o,{id:i}=e,{name:a}=e,{value:s}=e,{record:c}=e,{classId:l}=e,{disabled:d}=e,{readonly:u}=e;const h=c._id||Math.floor(9e3*Math.random()+1e3).toString();u||=d;const m=t=>{signature=t,signatureMap.set(h,signature),r("blur",{value:signature})};return onMount(()=>{signature=s||signatureMap.get(h)||"",signatureMap.set(h,signature);const t=document.querySelector("canvas");n(8,o=new SignaturePad(t)),u||(o.addEventListener("endStroke",()=>{m(o.toDataURL("image/png"))}),o.addEventListener("afterUpdateStroke",()=>{m(o.toDataURL("image/png"))}))}),onDestroy(()=>signatureMap.forEach((t,e,n)=>{e!==h&&n.delete(e)})),t.$$set=t=>{"id"in t&&n(1,i=t.id),"name"in t&&n(2,a=t.name),"value"in t&&n(6,s=t.value),"record"in t&&n(7,c=t.record),"classId"in t&&n(3,l=t.classId),"disabled"in t&&n(4,d=t.disabled),"readonly"in t&&n(0,u=t.readonly)},t.$$.update=()=>{256&t.$$.dirty&&signature&&o&&o.fromDataURL(signature,{ratio:1})},[u,i,a,l,d,()=>{o.clear(),m("")},s,c,o]}class InputSignature extends SvelteComponent{constructor(t){super(),document_1$2.getElementById("svelte-efkzkz-style")||add_css$6(),init(this,t,instance$7,create_fragment$7,safe_not_equal,{id:1,name:2,value:6,record:7,classId:3,disabled:4,readonly:0})}}function add_css$5(){var t=element("style");t.id="svelte-bcd9jd-style",t.textContent=".feather.svelte-bcd9jd.svelte-bcd9jd{position:absolute;top:0.75em;left:0.5em;color:#326173}.feather2.svelte-bcd9jd.svelte-bcd9jd{position:absolute;top:0.75em;left:0.5em;color:light-gray}.eList.svelte-bcd9jd.svelte-bcd9jd{height:fit-content;max-height:65vh;overflow-y:scroll;overflow-x:auto}.eList.svelte-bcd9jd table.svelte-bcd9jd{min-width:30vw;position:relative;width:max-content !important;max-width:50vh !important}.eList.svelte-bcd9jd table thead.svelte-bcd9jd{position:sticky;top:0;background:#326173;color:white}.eList.svelte-bcd9jd table thead tr.svelte-bcd9jd{height:2.3em}.eList.svelte-bcd9jd table tbody tr.svelte-bcd9jd{height:2.75em !important}th.svelte-bcd9jd.svelte-bcd9jd,td.svelte-bcd9jd.svelte-bcd9jd{padding-left:0.4em;padding-right:0.4em}",append(document.head,t)}function get_each_context$3(t,e,n){const r=t.slice();return r[36]=e[n],r[38]=n,r}function create_else_block_1$3(t){let e,n,r;return n=new BookOpenIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-bcd9jd"),attr(e,"title",t[21])},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block_2$3(t){let e,n,r,o,i;return n=new BookOpenIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-bcd9jd"),attr(e,"title",t[21])},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[22]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_if_block$5(t){let e,n,r;function o(e){t[28](e)}let i={class:"tModal",noClickaway:!0,$$slots:{default:[create_default_slot$4]},$$scope:{ctx:t}};return void 0!==t[8]&&(i.open=t[8]),e=new t[12]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};1536&r[0]|256&r[1]&&(o.$$scope={dirty:r,ctx:t}),!n&&256&r[0]&&(n=!0,o.open=t[8],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_default_slot_2$2(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_else_block$4(t){let e,n,r,o=(t[10]||"Keine Einträge gefunden!")+"";return{c(){e=element("tr"),n=element("td"),r=text(o),attr(n,"class","svelte-bcd9jd"),attr(e,"class","svelte-bcd9jd")},m(t,o){insert(t,e,o),append(e,n),append(n,r)},p(t,e){1024&e[0]&&o!==(o=(t[10]||"Keine Einträge gefunden!")+"")&&set_data(r,o)},d(t){t&&detach(e)}}}function create_if_block_1$4(t){let e,n=t[9],r=[];for(let e=0;e<n.length;e+=1)r[e]=create_each_block$3(get_each_context$3(t,n,e));return{c(){for(let t=0;t<r.length;t+=1)r[t].c();e=empty()},m(t,n){for(let e=0;e<r.length;e+=1)r[e].m(t,n);insert(t,e,n)},p(t,o){if(25166336&o[0]){let i;for(n=t[9],i=0;i<n.length;i+=1){const a=get_each_context$3(t,n,i);r[i]?r[i].p(a,o):(r[i]=create_each_block$3(a),r[i].c(),r[i].m(e.parentNode,e))}for(;i<r.length;i+=1)r[i].d(1);r.length=n.length}},d(t){destroy_each(r,t),t&&detach(e)}}}function create_each_block$3(t){let e,n,r,o,i,a,s=t[23](t[36])+"";return{c(){e=element("tr"),n=element("td"),r=text(s),o=space(),attr(n,"class","svelte-bcd9jd"),attr(e,"class","pointer svelte-bcd9jd")},m(s,c){insert(s,e,c),append(e,n),append(n,r),append(e,o),i||(a=listen(e,"click",stop_propagation(t[24](t[38]))),i=!0)},p(e,n){t=e,512&n[0]&&s!==(s=t[23](t[36])+"")&&set_data(r,s)},d(t){t&&detach(e),i=!1,a()}}}function create_default_slot_1$3(t){let e,n,r,o,i,a,s,c,l,d,u,h,m;function f(t,e){return t[9]?.length?create_if_block_1$4:create_else_block$4}n=new t[14]({props:{outline:!0,$$slots:{default:[create_default_slot_2$2]},$$scope:{ctx:t}}}),n.$on("click",t[25]),o=new t[15]({});let p=f(t),_=p(t);return{c(){e=element("div"),create_component(n.$$.fragment),r=space(),create_component(o.$$.fragment),i=space(),a=element("div"),s=element("table"),c=element("thead"),l=element("tr"),d=element("th"),d.textContent=`${t[20]}`,u=space(),h=element("tbody"),_.c(),attr(d,"class","svelte-bcd9jd"),attr(l,"class","svelte-bcd9jd"),attr(c,"class","svelte-bcd9jd"),attr(s,"striped",""),attr(s,"class","svelte-bcd9jd"),attr(a,"class","eList svelte-bcd9jd")},m(t,f){insert(t,e,f),mount_component(n,e,null),insert(t,r,f),mount_component(o,t,f),insert(t,i,f),insert(t,a,f),append(a,s),append(s,c),append(c,l),append(l,d),append(s,u),append(s,h),_.m(h,null),m=!0},p(t,e){const r={};256&e[1]&&(r.$$scope={dirty:e,ctx:t}),n.$set(r),p===(p=f(t))&&_?_.p(t,e):(_.d(1),_=p(t),_&&(_.c(),_.m(h,null)))},i(t){m||(transition_in(n.$$.fragment,t),transition_in(o.$$.fragment,t),m=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(o.$$.fragment,t),m=!1},d(t){t&&detach(e),destroy_component(n),t&&detach(r),destroy_component(o,t),t&&detach(i),t&&detach(a),_.d()}}}function create_default_slot$4(t){let e,n;return e=new t[13]({props:{title:t[21],class:"eList",$$slots:{default:[create_default_slot_1$3]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1536&n[0]|256&n[1]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$6(t){let e,n,r,o,i,a,s,c,l;function d(e){t[26](e)}let u={id:t[2],name:t[3].name,inputClass:t[5]||t[1],disabled:t[6],formnovalidate:t[7],readonly:t[18],pattern:t[17],required:t[19],style:"padding-left:2em;"};void 0!==t[0]&&(u.value=t[0]),n=new t[11]({props:u}),binding_callbacks.push(()=>bind(n,"value",d)),n.$on("change",t[27]);const h=[create_if_block_2$3,create_else_block_1$3],m=[];function f(t,e){return t[6]||t[4]._id?1:0}i=f(t),a=m[i]=h[i](t);let p=t[8]&&create_if_block$5(t);return{c(){e=element("div"),create_component(n.$$.fragment),o=space(),a.c(),s=space(),p&&p.c(),c=empty(),set_style(e,"position","relative")},m(t,r){insert(t,e,r),mount_component(n,e,null),append(e,o),m[i].m(e,null),insert(t,s,r),p&&p.m(t,r),insert(t,c,r),l=!0},p(t,o){const s={};4&o[0]&&(s.id=t[2]),8&o[0]&&(s.name=t[3].name),34&o[0]&&(s.inputClass=t[5]||t[1]),64&o[0]&&(s.disabled=t[6]),128&o[0]&&(s.formnovalidate=t[7]),!r&&1&o[0]&&(r=!0,s.value=t[0],add_flush_callback(()=>r=!1)),n.$set(s);let l=i;i=f(t),i===l?m[i].p(t,o):(group_outros(),transition_out(m[l],1,1,()=>{m[l]=null}),check_outros(),a=m[i],a?a.p(t,o):(a=m[i]=h[i](t),a.c()),transition_in(a,1),a.m(e,null)),t[8]?p?(p.p(t,o),256&o[0]&&transition_in(p,1)):(p=create_if_block$5(t),p.c(),transition_in(p,1),p.m(c.parentNode,c)):p&&(group_outros(),transition_out(p,1,1,()=>{p=null}),check_outros())},i(t){l||(transition_in(n.$$.fragment,t),transition_in(a),transition_in(p),l=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(a),transition_out(p),l=!1},d(t){t&&detach(e),destroy_component(n),m[i].d(),t&&detach(s),p&&p.d(t),t&&detach(c)}}}function instance$6(t,e,n){let r;const{TextField:o,Modal:i,Dialog:a,Button:s,Divider:c}=getAttractions,l=createEventDispatcher(),{environment:d}=user;component_subscribe(t,d,t=>n(29,r=t));let{classId:u}=e,{id:h}=e,{item:m}=e,{record:f={}}=e,{value:p}=e,{noForm:_=!1}=e,{disabled:g}=e,{formnovalidate:w}=e;const{properties:$={}}=m;let{pattern:y,placeholder:b,readonly:v,required:I=!1,format:C}=$,E=!1;const{service:{type:A,map:S,title:k,designation:T}}=C;let R,N;const D=()=>{n(8,E=!1)};return t.$$set=t=>{"classId"in t&&n(1,u=t.classId),"id"in t&&n(2,h=t.id),"item"in t&&n(3,m=t.item),"record"in t&&n(4,f=t.record),"value"in t&&n(0,p=t.value),"noForm"in t&&n(5,_=t.noForm),"disabled"in t&&n(6,g=t.disabled),"formnovalidate"in t&&n(7,w=t.formnovalidate)},[p,u,h,m,f,_,g,w,E,R,N,o,i,a,s,c,d,y,v,I,k,T,async()=>{g||f._id||(n(9,R=[]),n(10,N=""),p.length>3&&(n(9,R=await Request.getService("address",A,p)),Array.isArray(R)||n(10,N=R.error)),n(8,E=!0))},t=>S.map(({name:e})=>t[e]).filter(t=>!!t).join(", "),t=>()=>{const e=R[t],n=[];let o="";for(const{name:t,refItem:i}of S){const[a,s]=i.split(".");s?(o=a,"owner.country"===t&&(e[t]=r.country?._id||""),n.push({name:s,value:e[t]})):l("record",{itemName:i,value:e[t]})}n.length&&l("objRecord",{listName:o,items:n}),D()},D,function(t){p=t,n(0,p)},function(e){bubble(t,e)},function(t){E=t,n(8,E)}]}class InputService extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-bcd9jd-style")||add_css$5(),init(this,t,instance$6,create_fragment$6,safe_not_equal,{classId:1,id:2,item:3,record:4,value:0,noForm:5,disabled:6,formnovalidate:7},[-1,-1])}}function add_css$4(){var t=element("style");t.id="svelte-1xgbysl-style",t.textContent=".feather.svelte-1xgbysl{position:absolute;top:0.75em;left:0.5em;color:#4300b0}.feather2.svelte-1xgbysl{position:absolute;top:0.75em;left:0.5em;color:light-gray}",append(document.head,t)}function create_else_block$3(t){let e,n,r;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather2 svelte-1xgbysl")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_if_block$4(t){let e,n,r,o,i;return n=new ExternalLinkIcon({props:{size:"18"}}),{c(){e=element("span"),create_component(n.$$.fragment),attr(e,"class","feather pointer svelte-1xgbysl")},m(a,s){insert(a,e,s),mount_component(n,e,null),r=!0,o||(i=listen(e,"click",t[6]),o=!0)},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n),o=!1,i()}}}function create_fragment$5(t){let e,n,r,o,i,a;n=new t[5]({props:{inputClass:t[0],disabled:!0,formnovalidate:t[1],readonly:!0,id:t[2],name:t[3],value:t[4],style:"padding-left: 2em;"}});const s=[create_if_block$4,create_else_block$3],c=[];function l(t,e){return t[4]?0:1}return o=l(t),i=c[o]=s[o](t),{c(){e=element("div"),create_component(n.$$.fragment),r=space(),i.c(),set_style(e,"position","relative")},m(t,i){insert(t,e,i),mount_component(n,e,null),append(e,r),c[o].m(e,null),a=!0},p(t,[r]){const a={};1&r&&(a.inputClass=t[0]),2&r&&(a.formnovalidate=t[1]),4&r&&(a.id=t[2]),8&r&&(a.name=t[3]),16&r&&(a.value=t[4]),n.$set(a);let d=o;o=l(t),o===d?c[o].p(t,r):(group_outros(),transition_out(c[d],1,1,()=>{c[d]=null}),check_outros(),i=c[o],i?i.p(t,r):(i=c[o]=s[o](t),i.c()),transition_in(i,1),i.m(e,null))},i(t){a||(transition_in(n.$$.fragment,t),transition_in(i),a=!0)},o(t){transition_out(n.$$.fragment,t),transition_out(i),a=!1},d(t){t&&detach(e),destroy_component(n),c[o].d()}}}function instance$5(t,e,n){const{TextField:r}=getAttractions;let{inputClass:o}=e,{disabled:i}=e,{formnovalidate:a}=e,{readonly:s}=e,{required:c}=e,{id:l}=e,{name:d}=e,{value:u}=e,{record:h}=e;const m=h?.task;return t.$$set=t=>{"inputClass"in t&&n(0,o=t.inputClass),"disabled"in t&&n(7,i=t.disabled),"formnovalidate"in t&&n(1,a=t.formnovalidate),"readonly"in t&&n(8,s=t.readonly),"required"in t&&n(9,c=t.required),"id"in t&&n(2,l=t.id),"name"in t&&n(3,d=t.name),"value"in t&&n(4,u=t.value),"record"in t&&n(10,h=t.record)},[o,a,l,d,u,r,async()=>{m&&window.open(m)},i,s,c,h]}class InputTask extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-1xgbysl-style")||add_css$4(),init(this,t,instance$5,create_fragment$5,safe_not_equal,{inputClass:0,disabled:7,formnovalidate:1,readonly:8,required:9,id:2,name:3,value:4,record:10})}}function add_css$3(){var t=element("style");t.id="svelte-rxh0vh-style",t.textContent=".form-field{margin-bottom:0.5em !important}.form-field.hidden{display:none !important}.form-field > .description{padding-top:0.75em;color:black}.form-field div.field > label.checkbox{padding-top:0.5em}.form-field label.color_red{color:red}",append(document.head,t)}function create_else_block$2(t){let e,n;return e=new t[30]({props:{id:t[46](t[39]),class:t[0].name+(t[26]?" hidden ":""),nameClass:t[0].properties?.color?"color_"+t[0].properties.color:"",name:t[0].designation,help:t[0].properties?.hint,$$slots:{default:[create_default_slot_1$2,({notifyList:t})=>({24:t}),({notifyList:t})=>[t?16777216:0]]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};67108865&n[0]&&(r.class=t[0].name+(t[26]?" hidden ":"")),1&n[0]&&(r.nameClass=t[0].properties?.color?"color_"+t[0].properties.color:""),1&n[0]&&(r.name=t[0].designation),1&n[0]&&(r.help=t[0].properties?.hint),872415231&n[0]|262144&n[2]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_2$2(t){let e,n;return e=new t[33]({props:{text:t[0].designation}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[0]&&(r.text=t[0].designation),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_1$3(t){let e,n,r,o;return e=new t[30]({props:{id:t[46](t[39]),class:t[0].name+(t[26]?" hidden ":""),name:t[0].designation,help:t[0].properties?.hint}}),r=new InputRichtext({props:{classId:t[9],disabled:t[3],readonly:t[25],id:t[39],name:t[0].name,value:t[28](),record:t[1],noForm:t[8]}}),r.$on("blur",t[42]()),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};67108865&n[0]&&(o.class=t[0].name+(t[26]?" hidden ":"")),1&n[0]&&(o.name=t[0].designation),1&n[0]&&(o.help=t[0].properties?.hint),e.$set(o);const i={};512&n[0]&&(i.classId=t[9]),8&n[0]&&(i.disabled=t[3]),33554432&n[0]&&(i.readonly=t[25]),1&n[0]&&(i.name=t[0].name),268435456&n[0]&&(i.value=t[28]()),2&n[0]&&(i.record=t[1]),256&n[0]&&(i.noForm=t[8]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_if_block$3(t){let e,n,r,o,i,a;return e=new t[30]({props:{id:t[46](t[39]),class:t[0].name+" hidden",name:t[0].designation,help:t[0].properties?.hint,$$slots:{default:[create_default_slot$3]},$$scope:{ctx:t}}}),r=new t[33]({props:{text:t[29]}}),i=new InputObjectReference({props:{required:t[4],disabled:t[3],readonly:t[25],id:t[39],item:t[0],currency:t[19],value:t[28]()}}),i.$on("setRefValue",t[47]),i.$on("safeReference",t[52]),i.$on("objRecord",t[53]),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment),o=space(),create_component(i.$$.fragment)},m(t,s){mount_component(e,t,s),insert(t,n,s),mount_component(r,t,s),insert(t,o,s),mount_component(i,t,s),a=!0},p(t,n){const o={};1&n[0]&&(o.class=t[0].name+" hidden"),1&n[0]&&(o.name=t[0].designation),1&n[0]&&(o.help=t[0].properties?.hint),402654721&n[0]|262144&n[2]&&(o.$$scope={dirty:n,ctx:t}),e.$set(o);const a={};536870912&n[0]&&(a.text=t[29]),r.$set(a);const s={};16&n[0]&&(s.required=t[4]),8&n[0]&&(s.disabled=t[3]),33554432&n[0]&&(s.readonly=t[25]),1&n[0]&&(s.item=t[0]),524288&n[0]&&(s.currency=t[19]),268435456&n[0]&&(s.value=t[28]()),i.$set(s)},i(t){a||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),transition_in(i.$$.fragment,t),a=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),transition_out(i.$$.fragment,t),a=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t),t&&detach(o),destroy_component(i,t)}}}function create_else_block_1$2(t){let e,n;return e=new t[31]({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],pattern:t[35],required:!0===t[4],placeholder:t[37],id:t[39],name:t[38],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=!0===t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_26(t){let e,n;return e=new InputTel({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],pattern:t[35],placeholder:t[37],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_25(t){let e,n;return e=new InputTask({props:{inputClass:t[8]||t[9],formnovalidate:t[12],id:t[39],name:t[38],value:t[28](),record:t[1],"}":!0}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),4096&n[0]&&(r.formnovalidate=t[12]),268435456&n[0]&&(r.value=t[28]()),2&n[0]&&(r.record=t[1]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_24(t){let e,n;return e=new InputUrl({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_23$1(t){let e,n;return e=new InputMail({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],pattern:t[35],multiple:t[36],placeholder:t[37],value:t[28]()}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_22$1(t){let e,n;return e=new InputTime({props:{inputClass:t[8]||t[9],disabled:t[3],readonly:t[25],required:t[4],id:t[39],item:t[0],value:t[28](),praefix:t[5]}}),e.$on("blur",t[42]()),e.$on("checkRange",t[71]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),268435456&n[0]&&(r.value=t[28]()),32&n[0]&&(r.praefix=t[5]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_21$1(t){let e,n;return e=new InputMap({props:{inputClass:t[8]||t[9],disabled:t[3],formnovalidate:t[12],readonly:t[25],required:t[4],id:t[39],name:t[38],value:t[28](),record:t[1],item:t[0]}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.value=t[28]()),2&n[0]&&(r.record=t[1]),1&n[0]&&(r.item=t[0]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_20$1(t){let e,n;return e=new InputDateTime({props:{classId:t[9],id:t[39],disabled:t[3],required:t[4],value:t[40](),noForm:t[8]}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_19$1(t){let e,n;return e=new InputDateRange({props:{classId:t[9],id:t[39],item:t[0],disabled:t[3],required:t[4],value:t[41](),noForm:t[8]}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1&n[0]&&(r.item=t[0]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_18$1(t){let e,n;return e=new InputDate({props:{classId:t[9],eventId:t[10],id:t[39],item:t[0],record:t[1],readonly:t[25],disabled:t[3],required:t[4],praefix:t[5],value:t[40](),noForm:t[8],notifyList:t[24],dateInput:t[23]}}),e.$on("change",t[42](!0)),e.$on("formula",t[69]),e.$on("record",t[70]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),33554432&n[0]&&(r.readonly=t[25]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),32&n[0]&&(r.praefix=t[5]),256&n[0]&&(r.noForm=t[8]),16777216&n[0]&&(r.notifyList=t[24]),8388608&n[0]&&(r.dateInput=t[23]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_17$1(t){let e,n;return e=new t[32]({props:{round:!0,inputClass:t[8]||t[9],disabled:t[3]||t[25],required:t[4],id:t[39],name:t[38],checked:t[28](),value:t[28](!0)}}),e.$on("change",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]&&(r.inputClass=t[8]||t[9]),33554440&n[0]&&(r.disabled=t[3]||t[25]),16&n[0]&&(r.required=t[4]),268435456&n[0]&&(r.checked=t[28]()),268435456&n[0]&&(r.value=t[28](!0)),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_16$1(t){let e,n;return e=new InputLookup({props:{id:t[39],item:t[0],praefix:t[5],record:t[1],notifyList:t[24]}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[0]&&(r.item=t[0]),32&n[0]&&(r.praefix=t[5]),2&n[0]&&(r.record=t[1]),16777216&n[0]&&(r.notifyList=t[24]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_15$1(t){let e,n;return e=new InputAutocomplete({props:{classId:t[9],item:t[0],record:t[1],listName:t[6],disabled:t[3],formnovalidate:t[12],readonly:t[25],pattern:t[35],required:!0===t[4],placeholder:t[37],id:t[39],name:t[38],value:t[28]()}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),64&n[0]&&(r.listName=t[6]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=!0===t[4]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_14$2(t){let e,n;return e=new InputView({props:{classId:t[9],disabled:t[3],required:t[4],id:t[39],item:t[0],record:t[1],value:t[28](),noForm:t[8],view:t[0].properties.view,praefix:t[5]}}),e.$on("blur",t[42]()),e.$on("invalid",t[68]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.view=t[0].properties.view),32&n[0]&&(r.praefix=t[5]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_13$2(t){let e,n;return e=new InputMulti({props:{classId:t[9],disabled:t[3],required:t[4],id:t[39],item:t[0],record:t[1],value:t[28](),noForm:t[8],multi:t[0].properties.multi,numberInput:t[14],praefix:t[5],toDelete:t[17],reqQuantity:t[18],notifyList:t[24]}}),e.$on("blur",t[42]()),e.$on("invalid",t[67]),e.$on("record",t[43]),e.$on("multi",t[44]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.multi=t[0].properties.multi),16384&n[0]&&(r.numberInput=t[14]),32&n[0]&&(r.praefix=t[5]),131072&n[0]&&(r.toDelete=t[17]),262144&n[0]&&(r.reqQuantity=t[18]),16777216&n[0]&&(r.notifyList=t[24]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_12$2(t){let e,n;return e=new InputNumber({props:{classId:t[9],disabled:t[3],formnovalidate:t[12],required:t[4],readonly:t[25],id:t[39],item:t[0],currency:t[19],value:t[28](),praefix:t[5],notifyList:t[24],noForm:t[8]}}),e.$on("blur",t[42]()),e.$on("formula",t[64]),e.$on("listRecord",t[65]),e.$on("record",t[66]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),16&n[0]&&(r.required=t[4]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),524288&n[0]&&(r.currency=t[19]),268435456&n[0]&&(r.value=t[28]()),32&n[0]&&(r.praefix=t[5]),16777216&n[0]&&(r.notifyList=t[24]),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_11$2(t){let e,n;return e=new InputService({props:{classId:t[9],disabled:t[3],readonly:t[25],required:t[4],id:t[39],item:t[0],record:t[1],value:t[28](),noForm:t[8]}}),e.$on("change",t[42]()),e.$on("record",t[62]),e.$on("objRecord",t[63]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_10$2(t){let e,n;return e=new InputSelect({props:{classId:t[9],disabled:t[3],required:t[4],id:t[39],item:t[0],value:t[28](),noForm:t[8]}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),16&n[0]&&(r.required=t[4]),1&n[0]&&(r.item=t[0]),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_9$2(t){let e,n;return e=new InputSignature({props:{classId:t[9],disabled:t[3],readonly:t[25],id:t[39],name:t[0].name,value:t[28](),record:t[1],noForm:t[8],placeholder:t[0].properties?.placeholder}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.name=t[0].name),268435456&n[0]&&(r.value=t[28]()),2&n[0]&&(r.record=t[1]),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.placeholder=t[0].properties?.placeholder),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_8$2(t){let e,n;return e=new InputFilePDF({props:{praefix:t[5],classId:t[9],disabled:t[3],readonly:t[25],item:t[0],id:t[39],name:t[0].name,eventId:t[10],record:t[1],recordId:t[2],value:t[28](),fileType:t[0].properties?.accept}}),e.$on("record",t[60]),e.$on("listRecord",t[61]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};32&n[0]&&(r.praefix=t[5]),512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),1&n[0]&&(r.name=t[0].name),1024&n[0]&&(r.eventId=t[10]),2&n[0]&&(r.record=t[1]),4&n[0]&&(r.recordId=t[2]),268435456&n[0]&&(r.value=t[28]()),1&n[0]&&(r.fileType=t[0].properties?.accept),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_7$2(t){let e,n;return e=new InputFileQR({props:{praefix:t[5],classId:t[9],disabled:t[3],readonly:t[25],item:t[0],id:t[39],name:t[0].name,eventId:t[10],record:t[1],value:t[28]()}}),e.$on("record",t[59]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};32&n[0]&&(r.praefix=t[5]),512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),1&n[0]&&(r.name=t[0].name),1024&n[0]&&(r.eventId=t[10]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_6$2(t){let e,n;return e=new InputFile({props:{classId:t[9],disabled:t[3],readonly:t[25],item:t[0],id:t[39],name:t[0].name,eventId:t[10],record:t[1],value:t[28]()}}),e.$on("record",t[58]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),1&n[0]&&(r.name=t[0].name),1024&n[0]&&(r.eventId=t[10]),2&n[0]&&(r.record=t[1]),268435456&n[0]&&(r.value=t[28]()),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_5$2(t){let e,n;return e=new TextArea({props:{classId:t[9],disabled:t[3],readonly:t[25],id:t[39],name:t[0].name,value:t[28](),noForm:t[8],standard:!0,style:"",placeholder:t[0].properties?.placeholder}}),e.$on("blur",t[42]()),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),8&n[0]&&(r.disabled=t[3]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.name=t[0].name),268435456&n[0]&&(r.value=t[28]()),256&n[0]&&(r.noForm=t[8]),1&n[0]&&(r.placeholder=t[0].properties?.placeholder),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_4$2(t){let e,n;return e=new InputReference({props:{classId:t[9],eventId:t[10],fullRecord:t[7],required:t[4],disabled:t[3],formnovalidate:t[12],readonly:t[25],id:t[39],item:t[0],desc:t[29],value:t[28](),multiValues:t[20],noForm:t[8],praefix:t[5],selectionFields:t[11],selection:t[13],deList:t[15],recordId:t[2],isTemplate:t[16],shortEdit:t[21],initFinished:t[22]}}),e.$on("task",t[56]),e.$on("change",t[42]()),e.$on("initFail",t[45]),e.$on("defPrep",t[57]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),128&n[0]&&(r.fullRecord=t[7]),16&n[0]&&(r.required=t[4]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),536870912&n[0]&&(r.desc=t[29]),268435456&n[0]&&(r.value=t[28]()),1048576&n[0]&&(r.multiValues=t[20]),256&n[0]&&(r.noForm=t[8]),32&n[0]&&(r.praefix=t[5]),2048&n[0]&&(r.selectionFields=t[11]),8192&n[0]&&(r.selection=t[13]),32768&n[0]&&(r.deList=t[15]),4&n[0]&&(r.recordId=t[2]),65536&n[0]&&(r.isTemplate=t[16]),2097152&n[0]&&(r.shortEdit=t[21]),4194304&n[0]&&(r.initFinished=t[22]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_3$2(t){let e,n;return e=new InputReferenceMulti({props:{classId:t[9],eventId:t[10],required:t[4],disabled:t[3],formnovalidate:t[12],readonly:t[25],id:t[39],item:t[0],record:t[1],desc:t[29],values:t[28]()||[],noForm:t[8],praefix:t[5],selectionFields:t[11],selection:t[13],deList:t[15],recordId:t[2],isTemplate:t[16]}}),e.$on("task",t[54]),e.$on("change",t[42]()),e.$on("multi",t[44]),e.$on("initFail",t[45]),e.$on("defPrep",t[55]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),16&n[0]&&(r.required=t[4]),8&n[0]&&(r.disabled=t[3]),4096&n[0]&&(r.formnovalidate=t[12]),33554432&n[0]&&(r.readonly=t[25]),1&n[0]&&(r.item=t[0]),2&n[0]&&(r.record=t[1]),536870912&n[0]&&(r.desc=t[29]),268435456&n[0]&&(r.values=t[28]()||[]),256&n[0]&&(r.noForm=t[8]),32&n[0]&&(r.praefix=t[5]),2048&n[0]&&(r.selectionFields=t[11]),8192&n[0]&&(r.selection=t[13]),32768&n[0]&&(r.deList=t[15]),4&n[0]&&(r.recordId=t[2]),65536&n[0]&&(r.isTemplate=t[16]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_1$2(t){let e,n,r,o;const i=[create_if_block_3$2,create_if_block_4$2,create_if_block_5$2,create_if_block_6$2,create_if_block_7$2,create_if_block_8$2,create_if_block_9$2,create_if_block_10$2,create_if_block_11$2,create_if_block_12$2,create_if_block_13$2,create_if_block_14$2,create_if_block_15$1,create_if_block_16$1,create_if_block_17$1,create_if_block_18$1,create_if_block_19$1,create_if_block_20$1,create_if_block_21$1,create_if_block_22$1,create_if_block_23$1,create_if_block_24,create_if_block_25,create_if_block_26,create_else_block_1$2],a=[];function s(t,e){return"object"===t[0].type&&t[0].properties?.multi?0:"object"===t[0].type?1:"textarea"===t[0].type||t[0].properties&&"textarea"===t[0].properties.format?2:"file"===t[0].type?3:"fileQR"===t[0].type?4:"filePDF"===t[0].type?5:"signature"===t[0].type?6:t[0].properties&&(t[0].properties.enum||t[0].properties.regulation)?7:t[0].properties?.format?.service?8:"number"===t[0].type?9:t[0].properties&&t[0].properties.multi?10:t[0].properties&&t[0].properties.view&&"lookup"!==t[0].properties.format?11:t[0].properties?.autocomplete?12:"lookup"===t[0].properties?.format?13:"boolean"===t[0].type?14:"date"===t[0].type?15:"dateRange"===t[0].type?16:"datetime"===t[0].type?17:"map"===t[0].properties?.format?18:"time"===t[0].properties?.format?19:"email"===t[0].type||"email"===t[0].properties?.format?20:"url"===t[0].properties?.format?21:"task"===t[0].properties?.format?22:"tel"===t[0].properties?.format?23:24}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_default_slot$3(t){let e,n;return e=new InputReference({props:{classId:t[9],eventId:t[10],disabled:!0,readonly:!0,id:t[39],item:t[0],value:t[28](),noList:!0,withRefValue:!0,refValue:t[27]}}),e.$on("setRefDesc",t[48]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};512&n[0]&&(r.classId=t[9]),1024&n[0]&&(r.eventId=t[10]),1&n[0]&&(r.item=t[0]),268435456&n[0]&&(r.value=t[28]()),134217728&n[0]&&(r.refValue=t[27]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$4(t){let e,n,r,o;const i=[create_if_block$3,create_if_block_1$3,create_if_block_2$2,create_else_block$2],a=[];function s(t,e){return t[5]||"reference"!==t[0].saveAs||"object"!==t[0].type?"html"===t[0].properties?.format?1:"divider"===t[0].type?2:3:0}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function instance$4(t,e,n){let r,o,i,a;const s=createEventDispatcher(),{FormField:c,TextField:l,DatePicker:d,TimePicker:u,Checkbox:h,Divider:m}=getAttractions,{environment:f}=user;component_subscribe(t,f,t=>n(51,a=t));let{praefix:p=""}=e,{item:_}=e,{listName:g=""}=e,{fullRecord:w}=e,{record:$}=e,{recordId:y}=e,{noForm:b=!1}=e,{classId:v}=e,{eventId:I}=e,{disabled:C}=e,{selectionFields:E}=e,{formnovalidate:A}=e,{selection:S=!1}=e,{notifyList:k}=e,{numberInput:T}=e,{deList:R}=e,{required:N}=e,{isTemplate:D}=e,{toDelete:x}=e,{reqQuantity:O}=e,{currency:M}=e,{changeValue:P}=e,{propSelection:B}=e,{multiValues:F}=e,{shortEdit:L}=e,{initFinished:q}=e,{dateInput:V}=e;y||=$._id;let{required:H,readonly:U,hidden:z,pattern:W,multiple:j,placeholder:G}=_.properties||{};if(z=!0===z,void 0!==U&&(U=!0===U),U||=y&&_.asInput,void 0===N&&(N=H),C=C||!!U,"string"==typeof _.name){const[t,e]=_.name.split("_");e&&(_.name=e)}const X=(g?g+".":"")+_.name,Q=X+(""!==p?"-"+p:""),Y=(t,e=X)=>{try{return e.split(".").reduce((t,e)=>t[e],t)}catch(t){return""}},Z=async t=>{const{list:e,values:n}=_.process;if(!t)return void s("save",{itemName:e,value:[],addToRecord:!0});const r={},o=await Request.getSchema(I);for(const t in n){const i=n[t];if(t.includes(".")){const[n,a]=t.split("."),s={[a]:i};let c=await Request.getSectionView(n,s);if(!c?.length)continue;c=c[0],r[n]=c._id;const l=o.list.find(t=>t.name===e);for(const t of l.item){const{name:e}=t;r[e]||(r[e]=c[e])}}else r[t]=i}s("save",{itemName:e,value:[r],addToRecord:!0})};let K=Y($);return t.$$set=t=>{"praefix"in t&&n(5,p=t.praefix),"item"in t&&n(0,_=t.item),"listName"in t&&n(6,g=t.listName),"fullRecord"in t&&n(7,w=t.fullRecord),"record"in t&&n(1,$=t.record),"recordId"in t&&n(2,y=t.recordId),"noForm"in t&&n(8,b=t.noForm),"classId"in t&&n(9,v=t.classId),"eventId"in t&&n(10,I=t.eventId),"disabled"in t&&n(3,C=t.disabled),"selectionFields"in t&&n(11,E=t.selectionFields),"formnovalidate"in t&&n(12,A=t.formnovalidate),"selection"in t&&n(13,S=t.selection),"notifyList"in t&&n(24,k=t.notifyList),"numberInput"in t&&n(14,T=t.numberInput),"deList"in t&&n(15,R=t.deList),"required"in t&&n(4,N=t.required),"isTemplate"in t&&n(16,D=t.isTemplate),"toDelete"in t&&n(17,x=t.toDelete),"reqQuantity"in t&&n(18,O=t.reqQuantity),"currency"in t&&n(19,M=t.currency),"changeValue"in t&&n(49,P=t.changeValue),"propSelection"in t&&n(50,B=t.propSelection),"multiValues"in t&&n(20,F=t.multiValues),"shortEdit"in t&&n(21,L=t.shortEdit),"initFinished"in t&&n(22,q=t.initFinished),"dateInput"in t&&n(23,V=t.dateInput)},t.$$.update=()=>{if(1&t.$$.dirty[0]|524288&t.$$.dirty[1]&&B&&_.properties?.selection){const{refClass:t,refItem:e,target:n}=_.properties.selection,r=B.record[t];s("propSelection",{itemName:_.name,itemType:_.type,prop:e,target:n,source:t,sourceId:r})}if(262144&t.$$.dirty[1])for(const t in P)t===X&&n(1,$[X]=P[t],$);7&t.$$.dirty[0]|1048576&t.$$.dirty[1]&&n(28,r=(t=!1)=>{let e;return y||"number"!==_.type&&"string"!==_.type||!_.refItemAlt?.startsWith||!_.refItemAlt.startsWith("owner.")||+Y($)?y||"number"!==_.type&&"string"!==_.type||!_.refItem?.startsWith||!_.refItem.startsWith("owner.")?(e=Y($),!e&&_.properties?.useId&&(e=$._id),t&&(e=!!e),void 0===e?"":e):(e=Y(a,_.refItem),void 0===e?"":e):(e=Y(a,_.refItemAlt),void 0===e?"":e)}),2&t.$$.dirty[0]&&(i=Y($))},n(29,o=((t=X)=>{let e=$["_"+t];return e=checkDate(e),void 0===e?"":e})()),[_,$,y,C,N,p,g,w,b,v,I,E,A,S,T,R,D,x,O,M,F,L,q,V,k,U,z,K,r,o,c,l,h,m,f,W,j,G,X,Q,(t=X)=>{let e=Y($);return e?new Date(e):""===p?(()=>{const t=new Date;return new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate()-1,23))})():void 0},(t=X)=>{const e=Y($,t+"_from"),n=Y($,t+"_to");return{from:void 0===e?e:new Date(e),to:void 0===n?n:new Date(n)}},t=>({detail:e})=>{let{value:r,checked:o,range:a}=e;void 0!==o&&(r=o);const c=X+(a||"");n(1,$[c]=t?formatDateTime(r,"%d.%m.%Y"):r,$);const l=Object.values($).every(t=>!t)&&r;s("notify",{oldValue:i,value:r,add:l,itemName:c,desc:e.description}),"boolean"===_.type&&_.process&&Z(o)},({detail:t})=>{s("record",t)},({detail:t})=>{s("multi",t)},()=>n(26,z=!0),()=>"object"===_.type?"comment_"+Q:Q,({detail:t})=>{n(27,K=t)},({detail:t})=>{const{designation:e}=_;n(29,o=e+": "+(t||"(Neu)"))},P,B,a,function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)},function(e){bubble(t,e)}]}class InputFormField extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-rxh0vh-style")||add_css$3(),init(this,t,instance$4,create_fragment$4,safe_not_equal,{praefix:5,item:0,listName:6,fullRecord:7,record:1,recordId:2,noForm:8,classId:9,eventId:10,disabled:3,selectionFields:11,formnovalidate:12,selection:13,notifyList:24,numberInput:14,deList:15,required:4,isTemplate:16,toDelete:17,reqQuantity:18,currency:19,changeValue:49,propSelection:50,multiValues:20,shortEdit:21,initFinished:22,dateInput:23},[-1,-1,-1])}}var Html5QrcodeSupportedFormats;!function(t){t[t.QR_CODE=0]="QR_CODE",t[t.AZTEC=1]="AZTEC",t[t.CODABAR=2]="CODABAR",t[t.CODE_39=3]="CODE_39",t[t.CODE_93=4]="CODE_93",t[t.CODE_128=5]="CODE_128",t[t.DATA_MATRIX=6]="DATA_MATRIX",t[t.MAXICODE=7]="MAXICODE",t[t.ITF=8]="ITF",t[t.EAN_13=9]="EAN_13",t[t.EAN_8=10]="EAN_8",t[t.PDF_417=11]="PDF_417",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(Html5QrcodeSupportedFormats||(Html5QrcodeSupportedFormats={}));var html5QrcodeSupportedFormatsTextMap=new Map([[Html5QrcodeSupportedFormats.QR_CODE,"QR_CODE"],[Html5QrcodeSupportedFormats.AZTEC,"AZTEC"],[Html5QrcodeSupportedFormats.CODABAR,"CODABAR"],[Html5QrcodeSupportedFormats.CODE_39,"CODE_39"],[Html5QrcodeSupportedFormats.CODE_93,"CODE_93"],[Html5QrcodeSupportedFormats.CODE_128,"CODE_128"],[Html5QrcodeSupportedFormats.DATA_MATRIX,"DATA_MATRIX"],[Html5QrcodeSupportedFormats.MAXICODE,"MAXICODE"],[Html5QrcodeSupportedFormats.ITF,"ITF"],[Html5QrcodeSupportedFormats.EAN_13,"EAN_13"],[Html5QrcodeSupportedFormats.EAN_8,"EAN_8"],[Html5QrcodeSupportedFormats.PDF_417,"PDF_417"],[Html5QrcodeSupportedFormats.RSS_14,"RSS_14"],[Html5QrcodeSupportedFormats.RSS_EXPANDED,"RSS_EXPANDED"],[Html5QrcodeSupportedFormats.UPC_A,"UPC_A"],[Html5QrcodeSupportedFormats.UPC_E,"UPC_E"],[Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),DecodedTextType,Html5QrcodeScanType;function isValidHtml5QrcodeSupportedFormats(t){return Object.values(Html5QrcodeSupportedFormats).includes(t)}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.URL=1]="URL"}(DecodedTextType||(DecodedTextType={})),function(t){t[t.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",t[t.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"}(Html5QrcodeScanType||(Html5QrcodeScanType={}));var Html5QrcodeConstants=function(){function t(){}return t.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",t.SCAN_DEFAULT_FPS=2,t.DEFAULT_DISABLE_FLIP=!1,t.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,t.DEFAULT_SUPPORTED_SCAN_TYPE=[Html5QrcodeScanType.SCAN_TYPE_CAMERA,Html5QrcodeScanType.SCAN_TYPE_FILE],t}(),QrcodeResultFormat=function(){function t(t,e){this.format=t,this.formatName=e}return t.prototype.toString=function(){return this.formatName},t.create=function(e){if(!html5QrcodeSupportedFormatsTextMap.has(e))throw"".concat(e," not in html5QrcodeSupportedFormatsTextMap");return new t(e,html5QrcodeSupportedFormatsTextMap.get(e))},t}(),Html5QrcodeResultFactory=function(){function t(){}return t.createFromText=function(t){return{decodedText:t,result:{text:t}}},t.createFromQrcodeResult=function(t){return{decodedText:t.text,result:t}},t}(),Html5QrcodeErrorTypes;!function(t){t[t.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",t[t.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",t[t.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"}(Html5QrcodeErrorTypes||(Html5QrcodeErrorTypes={}));var Html5QrcodeErrorFactory=function(){function t(){}return t.createFrom=function(t){return{errorMessage:t,type:Html5QrcodeErrorTypes.UNKWOWN_ERROR}},t}(),BaseLoggger=function(){function t(t){this.verbose=t}return t.prototype.log=function(t){this.verbose&&console.log(t)},t.prototype.warn=function(t){this.verbose&&console.warn(t)},t.prototype.logError=function(t,e){(this.verbose||!0===e)&&console.error(t)},t.prototype.logErrors=function(t){if(0===t.length)throw"Logger#logError called without arguments";this.verbose&&console.error(t)},t}();function isNullOrUndefined(t){return null==t}var Html5QrcodeStrings=function(){function t(){}return t.codeParseError=function(t){return"QR code parse error, error = ".concat(t)},t.errorGettingUserMedia=function(t){return"Error getting userMedia, error = ".concat(t)},t.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},t.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},t.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},t.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},t.scannerPaused=function(){return"Scanner paused"},t}(),VideoConstraintsUtil=function(){function t(){}return t.isMediaStreamConstraintsValid=function(t,e){if("object"!=typeof t){var n=typeof t;return e.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(n,"."),!0),!1}for(var r=new Set(["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"]),o=0,i=Object.keys(t);o<i.length;o++){var a=i[o];if(r.has(a))return e.logError("".concat(a," is not supported videoConstaints."),!0),!1}return!0},t}(),zxingJs_umd=createCommonjsModule(function(t,e){!function(t){function e(t){return null==t}var n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])};function r(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function o(t,e){var n=Object.setPrototypeOf;n?n(t,e):t.__proto__=e}function i(t,e){void 0===e&&(e=t.constructor);var n=Error.captureStackTrace;n&&n(t,e)}var a,s=function(t){function e(e){var n=this.constructor,r=t.call(this,e)||this;return Object.defineProperty(r,"name",{value:n.name,enumerable:!1}),o(r,n.prototype),i(r),r}return r(e,t),e}(Error);class c extends s{constructor(t=void 0){super(t),this.message=t}getKind(){return this.constructor.kind}}c.kind="Exception";class l extends c{}l.kind="ArgumentException";class d extends c{}d.kind="IllegalArgumentException";class u{constructor(t){if(this.binarizer=t,null===t)throw new d("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(t,e){return this.binarizer.getBlackRow(t,e)}getBlackMatrix(){return null!==this.matrix&&void 0!==this.matrix||(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(t,e,n,r){const o=this.binarizer.getLuminanceSource().crop(t,e,n,r);return new u(this.binarizer.createBinarizer(o))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new u(this.binarizer.createBinarizer(t))}rotateCounterClockwise45(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new u(this.binarizer.createBinarizer(t))}toString(){try{return this.getBlackMatrix().toString()}catch(t){return""}}}class h extends c{static getChecksumInstance(){return new h}}h.kind="ChecksumException";class m{constructor(t){this.source=t}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class f{static arraycopy(t,e,n,r,o){for(;o--;)n[r++]=t[e++]}static currentTimeMillis(){return Date.now()}}class p extends c{}p.kind="IndexOutOfBoundsException";class _ extends p{constructor(t=void 0,e=void 0){super(e),this.index=t,this.message=e}}_.kind="ArrayIndexOutOfBoundsException";class g{static fill(t,e){for(let n=0,r=t.length;n<r;n++)t[n]=e}static fillWithin(t,e,n,r){g.rangeCheck(t.length,e,n);for(let o=e;o<n;o++)t[o]=r}static rangeCheck(t,e,n){if(e>n)throw new d("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new _(e);if(n>t)throw new _(n)}static asList(...t){return t}static create(t,e,n){return Array.from({length:t}).map(t=>Array.from({length:e}).fill(n))}static createInt32Array(t,e,n){return Array.from({length:t}).map(t=>Int32Array.from({length:e}).fill(n))}static equals(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}static hashCode(t){if(null===t)return 0;let e=1;for(const n of t)e=31*e+n;return e}static fillUint8Array(t,e){for(let n=0;n!==t.length;n++)t[n]=e}static copyOf(t,e){return t.slice(0,e)}static copyOfUint8Array(t,e){if(t.length<=e){const n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)}static copyOfRange(t,e,n){const r=n-e,o=new Int32Array(r);return f.arraycopy(t,e,o,0,r),o}static binarySearch(t,e,n){void 0===n&&(n=g.numberComparator);let r=0,o=t.length-1;for(;r<=o;){const i=o+r>>1,a=n(e,t[i]);if(a>0)r=i+1;else{if(!(a<0))return i;o=i-1}}return-r-1}static numberComparator(t,e){return t-e}}class w{static numberOfTrailingZeros(t){let e;if(0===t)return 32;let n=31;return e=t<<16,0!==e&&(n-=16,t=e),e=t<<8,0!==e&&(n-=8,t=e),e=t<<4,0!==e&&(n-=4,t=e),e=t<<2,0!==e&&(n-=2,t=e),n-(t<<1>>>31)}static numberOfLeadingZeros(t){if(0===t)return 32;let e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-=t>>>31,e}static toHexString(t){return t.toString(16)}static toBinaryString(t){return String(parseInt(String(t),2))}static bitCount(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,t+=t>>>8,63&(t+=t>>>16)}static truncDivision(t,e){return Math.trunc(t/e)}static parseInt(t,e=void 0){return parseInt(t,e)}}w.MIN_VALUE_32_BITS=-2147483648,w.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ${constructor(t,e){void 0===t?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,this.bits=null==e?$.makeArray(t):e)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(t){if(t>32*this.bits.length){const e=$.makeArray(t);f.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}}get(t){return!!(this.bits[Math.floor(t/32)]&1<<(31&t))}set(t){this.bits[Math.floor(t/32)]|=1<<(31&t)}flip(t){this.bits[Math.floor(t/32)]^=1<<(31&t)}getNextSet(t){const e=this.size;if(t>=e)return e;const n=this.bits;let r=Math.floor(t/32),o=n[r];o&=~((1<<(31&t))-1);const i=n.length;for(;0===o;){if(++r===i)return e;o=n[r]}const a=32*r+w.numberOfTrailingZeros(o);return a>e?e:a}getNextUnset(t){const e=this.size;if(t>=e)return e;const n=this.bits;let r=Math.floor(t/32),o=~n[r];o&=~((1<<(31&t))-1);const i=n.length;for(;0===o;){if(++r===i)return e;o=~n[r]}const a=32*r+w.numberOfTrailingZeros(o);return a>e?e:a}setBulk(t,e){this.bits[Math.floor(t/32)]=e}setRange(t,e){if(e<t||t<0||e>this.size)throw new d;if(e===t)return;e--;const n=Math.floor(t/32),r=Math.floor(e/32),o=this.bits;for(let i=n;i<=r;i++){const a=(2<<(i<r?31:31&e))-(1<<(i>n?0:31&t));o[i]|=a}}clear(){const t=this.bits.length,e=this.bits;for(let n=0;n<t;n++)e[n]=0}isRange(t,e,n){if(e<t||t<0||e>this.size)throw new d;if(e===t)return!0;e--;const r=Math.floor(t/32),o=Math.floor(e/32),i=this.bits;for(let a=r;a<=o;a++){const s=(2<<(a<o?31:31&e))-(1<<(a>r?0:31&t))&4294967295;if((i[a]&s)!==(n?s:0))return!1}return!0}appendBit(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(31&this.size)),this.size++}appendBits(t,e){if(e<0||e>32)throw new d("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(let n=e;n>0;n--)this.appendBit(1==(t>>n-1&1))}appendBitArray(t){const e=t.size;this.ensureCapacity(this.size+e);for(let n=0;n<e;n++)this.appendBit(t.get(n))}xor(t){if(this.size!==t.size)throw new d("Sizes don't match");const e=this.bits;for(let n=0,r=e.length;n<r;n++)e[n]^=t.bits[n]}toBytes(t,e,n,r){for(let o=0;o<r;o++){let r=0;for(let e=0;e<8;e++)this.get(t)&&(r|=1<<7-e),t++;e[n+o]=r}}getBitArray(){return this.bits}reverse(){const t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+1,r=this.bits;for(let o=0;o<n;o++){let n=r[o];n=n>>1&1431655765|(1431655765&n)<<1,n=n>>2&858993459|(858993459&n)<<2,n=n>>4&252645135|(252645135&n)<<4,n=n>>8&16711935|(16711935&n)<<8,n=n>>16&65535|(65535&n)<<16,t[e-o]=n}if(this.size!==32*n){const e=32*n-this.size;let r=t[0]>>>e;for(let o=1;o<n;o++){const n=t[o];r|=n<<32-e,t[o-1]=r,r=n>>>e}t[n-1]=r}this.bits=t}static makeArray(t){return new Int32Array(Math.floor((t+31)/32))}equals(t){if(!(t instanceof $))return!1;const e=t;return this.size===e.size&&g.equals(this.bits,e.bits)}hashCode(){return 31*this.size+g.hashCode(this.bits)}toString(){let t="";for(let e=0,n=this.size;e<n;e++)7&e||(t+=" "),t+=this.get(e)?"X":".";return t}clone(){return new $(this.size,this.bits.slice())}}!function(t){t[t.OTHER=0]="OTHER",t[t.PURE_BARCODE=1]="PURE_BARCODE",t[t.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",t[t.TRY_HARDER=3]="TRY_HARDER",t[t.CHARACTER_SET=4]="CHARACTER_SET",t[t.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",t[t.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",t[t.ASSUME_GS1=7]="ASSUME_GS1",t[t.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",t[t.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",t[t.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"}(a||(a={}));var y,b=a;class v extends c{static getFormatInstance(){return new v}}v.kind="FormatException",function(t){t[t.Cp437=0]="Cp437",t[t.ISO8859_1=1]="ISO8859_1",t[t.ISO8859_2=2]="ISO8859_2",t[t.ISO8859_3=3]="ISO8859_3",t[t.ISO8859_4=4]="ISO8859_4",t[t.ISO8859_5=5]="ISO8859_5",t[t.ISO8859_6=6]="ISO8859_6",t[t.ISO8859_7=7]="ISO8859_7",t[t.ISO8859_8=8]="ISO8859_8",t[t.ISO8859_9=9]="ISO8859_9",t[t.ISO8859_10=10]="ISO8859_10",t[t.ISO8859_11=11]="ISO8859_11",t[t.ISO8859_13=12]="ISO8859_13",t[t.ISO8859_14=13]="ISO8859_14",t[t.ISO8859_15=14]="ISO8859_15",t[t.ISO8859_16=15]="ISO8859_16",t[t.SJIS=16]="SJIS",t[t.Cp1250=17]="Cp1250",t[t.Cp1251=18]="Cp1251",t[t.Cp1252=19]="Cp1252",t[t.Cp1256=20]="Cp1256",t[t.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",t[t.UTF8=22]="UTF8",t[t.ASCII=23]="ASCII",t[t.Big5=24]="Big5",t[t.GB18030=25]="GB18030",t[t.EUC_KR=26]="EUC_KR"}(y||(y={}));class I{constructor(t,e,n,...r){this.valueIdentifier=t,this.name=n,this.values="number"==typeof e?Int32Array.from([e]):e,this.otherEncodingNames=r,I.VALUE_IDENTIFIER_TO_ECI.set(t,this),I.NAME_TO_ECI.set(n,this);const o=this.values;for(let t=0,e=o.length;t!==e;t++){const e=o[t];I.VALUES_TO_ECI.set(e,this)}for(const t of r)I.NAME_TO_ECI.set(t,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(t){if(t<0||t>=900)throw new v("incorect value");const e=I.VALUES_TO_ECI.get(t);if(void 0===e)throw new v("incorect value");return e}static getCharacterSetECIByName(t){const e=I.NAME_TO_ECI.get(t);if(void 0===e)throw new v("incorect value");return e}equals(t){if(!(t instanceof I))return!1;const e=t;return this.getName()===e.getName()}}I.VALUE_IDENTIFIER_TO_ECI=new Map,I.VALUES_TO_ECI=new Map,I.NAME_TO_ECI=new Map,I.Cp437=new I(y.Cp437,Int32Array.from([0,2]),"Cp437"),I.ISO8859_1=new I(y.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),I.ISO8859_2=new I(y.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),I.ISO8859_3=new I(y.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),I.ISO8859_4=new I(y.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),I.ISO8859_5=new I(y.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),I.ISO8859_6=new I(y.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),I.ISO8859_7=new I(y.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),I.ISO8859_8=new I(y.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),I.ISO8859_9=new I(y.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),I.ISO8859_10=new I(y.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),I.ISO8859_11=new I(y.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),I.ISO8859_13=new I(y.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),I.ISO8859_14=new I(y.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),I.ISO8859_15=new I(y.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),I.ISO8859_16=new I(y.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),I.SJIS=new I(y.SJIS,20,"SJIS","Shift_JIS"),I.Cp1250=new I(y.Cp1250,21,"Cp1250","windows-1250"),I.Cp1251=new I(y.Cp1251,22,"Cp1251","windows-1251"),I.Cp1252=new I(y.Cp1252,23,"Cp1252","windows-1252"),I.Cp1256=new I(y.Cp1256,24,"Cp1256","windows-1256"),I.UnicodeBigUnmarked=new I(y.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),I.UTF8=new I(y.UTF8,26,"UTF8","UTF-8"),I.ASCII=new I(y.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),I.Big5=new I(y.Big5,28,"Big5"),I.GB18030=new I(y.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),I.EUC_KR=new I(y.EUC_KR,30,"EUC_KR","EUC-KR");class C extends c{}C.kind="UnsupportedOperationException";class E{static decode(t,e){const n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):"undefined"==typeof TextDecoder||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)}static shouldDecodeOnFallback(t){return!E.isBrowser()&&"ISO-8859-1"===t}static encode(t,e){const n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t)}static isBrowser(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)}static encodingName(t){return"string"==typeof t?t:t.getName()}static encodingCharacterSet(t){return t instanceof I?t:I.getCharacterSetECIByName(t)}static decodeFallback(t,e){const n=this.encodingCharacterSet(e);if(E.isDecodeFallbackSupported(n)){let e="";for(let n=0,r=t.length;n<r;n++){let r=t[n].toString(16);r.length<2&&(r="0"+r),e+="%"+r}return decodeURIComponent(e)}if(n.equals(I.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new C(`Encoding ${this.encodingName(e)} not supported by fallback.`)}static isDecodeFallbackSupported(t){return t.equals(I.UTF8)||t.equals(I.ISO8859_1)||t.equals(I.ASCII)}static encodeFallback(t){const e=btoa(unescape(encodeURIComponent(t))).split(""),n=[];for(let t=0;t<e.length;t++)n.push(e[t].charCodeAt(0));return new Uint8Array(n)}}class A{static castAsNonUtf8Char(t,e=null){const n=e?e.getName():this.ISO88591;return E.decode(new Uint8Array([t]),n)}static guessEncoding(t,e){if(null!=e&&void 0!==e.get(b.CHARACTER_SET))return e.get(b.CHARACTER_SET).toString();const n=t.length;let r=!0,o=!0,i=!0,a=0,s=0,c=0,l=0,d=0,u=0,h=0,m=0,f=0,p=0,_=0;const g=t.length>3&&239===t[0]&&187===t[1]&&191===t[2];for(let e=0;e<n&&(r||o||i);e++){const n=255&t[e];i&&(a>0?128&n?a--:i=!1:128&n&&(64&n?(a++,32&n?(a++,16&n?(a++,8&n?i=!1:l++):c++):s++):i=!1)),r&&(n>127&&n<160?r=!1:n>159&&(n<192||215===n||247===n)&&_++),o&&(d>0?n<64||127===n||n>252?o=!1:d--:128===n||160===n||n>239?o=!1:n>160&&n<224?(u++,m=0,h++,h>f&&(f=h)):n>127?(d++,h=0,m++,m>p&&(p=m)):(h=0,m=0))}return i&&a>0&&(i=!1),o&&d>0&&(o=!1),i&&(g||s+c+l>0)?A.UTF8:o&&(A.ASSUME_SHIFT_JIS||f>=3||p>=3)?A.SHIFT_JIS:r&&o?2===f&&2===u||10*_>=n?A.SHIFT_JIS:A.ISO88591:r?A.ISO88591:o?A.SHIFT_JIS:i?A.UTF8:A.PLATFORM_DEFAULT_ENCODING}static format(t,...e){let n=-1;function r(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0===e[++n])return;t=i?parseInt(i.substr(1)):void 0;let c,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":c=e[n];break;case"c":c=e[n][0];break;case"f":c=parseFloat(e[n]).toFixed(t);break;case"p":c=parseFloat(e[n]).toPrecision(t);break;case"e":c=parseFloat(e[n]).toExponential(t);break;case"x":c=parseInt(e[n]).toString(l||16);break;case"d":c=parseFloat(parseInt(e[n],l||10).toPrecision(t)).toFixed(0)}c="object"==typeof c?JSON.stringify(c):(+c).toString(l);let d=parseInt(o),u=o&&o[0]+""=="0"?"0":" ";for(;c.length<d;)c=void 0!==r?c+u:u+c;return c}let o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,r)}static getBytes(t,e){return E.encode(t,e)}static getCharCode(t,e=0){return t.charCodeAt(e)}static getCharAt(t){return String.fromCharCode(t)}}A.SHIFT_JIS=I.SJIS.getName(),A.GB2312="GB2312",A.ISO88591=I.ISO8859_1.getName(),A.EUC_JP="EUC_JP",A.UTF8=I.UTF8.getName(),A.PLATFORM_DEFAULT_ENCODING=A.UTF8,A.ASSUME_SHIFT_JIS=!1;class S{constructor(t=""){this.value=t}enableDecoding(t){return this.encoding=t,this}append(t){return"string"==typeof t?this.value+=t.toString():this.encoding?this.value+=A.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this}appendChars(t,e,n){for(let r=e;e<e+n;r++)this.append(t[r]);return this}length(){return this.value.length}charAt(t){return this.value.charAt(t)}deleteCharAt(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)}setCharAt(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)}substring(t,e){return this.value.substring(t,e)}setLengthToZero(){this.value=""}toString(){return this.value}insert(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)}}class k{constructor(t,e,n,r){if(this.width=t,this.height=e,this.rowSize=n,this.bits=r,null==e&&(e=t),this.height=e,t<1||e<1)throw new d("Both dimensions must be greater than 0");null==n&&(n=Math.floor((t+31)/32)),this.rowSize=n,null==r&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(t){const e=t.length,n=t[0].length,r=new k(n,e);for(let o=0;o<e;o++){const e=t[o];for(let t=0;t<n;t++)e[t]&&r.set(t,o)}return r}static parseFromString(t,e,n){if(null===t)throw new d("stringRepresentation cannot be null");const r=new Array(t.length);let o=0,i=0,a=-1,s=0,c=0;for(;c<t.length;)if("\n"===t.charAt(c)||"\r"===t.charAt(c)){if(o>i){if(-1===a)a=o-i;else if(o-i!==a)throw new d("row lengths do not match");i=o,s++}c++}else if(t.substring(c,c+e.length)===e)c+=e.length,r[o]=!0,o++;else{if(t.substring(c,c+n.length)!==n)throw new d("illegal character encountered: "+t.substring(c));c+=n.length,r[o]=!1,o++}if(o>i){if(-1===a)a=o-i;else if(o-i!==a)throw new d("row lengths do not match");s++}const l=new k(a,s);for(let t=0;t<o;t++)r[t]&&l.set(Math.floor(t%a),Math.floor(t/a));return l}get(t,e){const n=e*this.rowSize+Math.floor(t/32);return!!(this.bits[n]>>>(31&t)&1)}set(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(31&t)&4294967295}unset(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(31&t)&4294967295)}flip(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(31&t)&4294967295}xor(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new d("input matrix dimensions do not match");const e=new $(Math.floor(this.width/32)+1),n=this.rowSize,r=this.bits;for(let o=0,i=this.height;o<i;o++){const i=o*n,a=t.getRow(o,e).getBitArray();for(let t=0;t<n;t++)r[i+t]^=a[t]}}clear(){const t=this.bits,e=t.length;for(let n=0;n<e;n++)t[n]=0}setRegion(t,e,n,r){if(e<0||t<0)throw new d("Left and top must be nonnegative");if(r<1||n<1)throw new d("Height and width must be at least 1");const o=t+n,i=e+r;if(i>this.height||o>this.width)throw new d("The region must fit inside the matrix");const a=this.rowSize,s=this.bits;for(let n=e;n<i;n++){const e=n*a;for(let n=t;n<o;n++)s[e+Math.floor(n/32)]|=1<<(31&n)&4294967295}}getRow(t,e){null==e||e.getSize()<this.width?e=new $(this.width):e.clear();const n=this.rowSize,r=this.bits,o=t*n;for(let t=0;t<n;t++)e.setBulk(32*t,r[o+t]);return e}setRow(t,e){f.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)}rotate180(){const t=this.getWidth(),e=this.getHeight();let n=new $(t),r=new $(t);for(let t=0,o=Math.floor((e+1)/2);t<o;t++)n=this.getRow(t,n),r=this.getRow(e-1-t,r),n.reverse(),r.reverse(),this.setRow(t,r),this.setRow(e-1-t,n)}getEnclosingRectangle(){const t=this.width,e=this.height,n=this.rowSize,r=this.bits;let o=t,i=e,a=-1,s=-1;for(let t=0;t<e;t++)for(let e=0;e<n;e++){const c=r[t*n+e];if(0!==c){if(t<i&&(i=t),t>s&&(s=t),32*e<o){let t=0;for(;!(c<<31-t&4294967295);)t++;32*e+t<o&&(o=32*e+t)}if(32*e+31>a){let t=31;for(;c>>>t===0;)t--;32*e+t>a&&(a=32*e+t)}}}return a<o||s<i?null:Int32Array.from([o,i,a-o+1,s-i+1])}getTopLeftOnBit(){const t=this.rowSize,e=this.bits;let n=0;for(;n<e.length&&0===e[n];)n++;if(n===e.length)return null;const r=n/t;let o=n%t*32;const i=e[n];let a=0;for(;!(i<<31-a&4294967295);)a++;return o+=a,Int32Array.from([o,r])}getBottomRightOnBit(){const t=this.rowSize,e=this.bits;let n=e.length-1;for(;n>=0&&0===e[n];)n--;if(n<0)return null;const r=Math.floor(n/t);let o=32*Math.floor(n%t);const i=e[n];let a=31;for(;i>>>a===0;)a--;return o+=a,Int32Array.from([o,r])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(t){if(!(t instanceof k))return!1;const e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&g.equals(this.bits,e.bits)}hashCode(){let t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+g.hashCode(this.bits),t}toString(t="X ",e=" ",n="\n"){return this.buildToString(t,e,n)}buildToString(t,e,n){let r=new S;for(let o=0,i=this.height;o<i;o++){for(let n=0,i=this.width;n<i;n++)r.append(this.get(n,o)?t:e);r.append(n)}return r.toString()}clone(){return new k(this.width,this.height,this.rowSize,this.bits.slice())}}class T extends c{static getNotFoundInstance(){return new T}}T.kind="NotFoundException";class R extends m{constructor(t){super(t),this.luminances=R.EMPTY,this.buckets=new Int32Array(R.LUMINANCE_BUCKETS)}getBlackRow(t,e){const n=this.getLuminanceSource(),r=n.getWidth();null==e||e.getSize()<r?e=new $(r):e.clear(),this.initArrays(r);const o=n.getRow(t,this.luminances),i=this.buckets;for(let t=0;t<r;t++)i[(255&o[t])>>R.LUMINANCE_SHIFT]++;const a=R.estimateBlackPoint(i);if(r<3)for(let t=0;t<r;t++)(255&o[t])<a&&e.set(t);else{let t=255&o[0],n=255&o[1];for(let i=1;i<r-1;i++){const r=255&o[i+1];(4*n-t-r)/2<a&&e.set(i),t=n,n=r}}return e}getBlackMatrix(){const t=this.getLuminanceSource(),e=t.getWidth(),n=t.getHeight(),r=new k(e,n);this.initArrays(e);const o=this.buckets;for(let r=1;r<5;r++){const i=Math.floor(n*r/5),a=t.getRow(i,this.luminances),s=Math.floor(4*e/5);for(let t=Math.floor(e/5);t<s;t++)o[(255&a[t])>>R.LUMINANCE_SHIFT]++}const i=R.estimateBlackPoint(o),a=t.getMatrix();for(let t=0;t<n;t++){const n=t*e;for(let o=0;o<e;o++)(255&a[n+o])<i&&r.set(o,t)}return r}createBinarizer(t){return new R(t)}initArrays(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));const e=this.buckets;for(let t=0;t<R.LUMINANCE_BUCKETS;t++)e[t]=0}static estimateBlackPoint(t){const e=t.length;let n=0,r=0,o=0;for(let i=0;i<e;i++)t[i]>o&&(r=i,o=t[i]),t[i]>n&&(n=t[i]);let i=0,a=0;for(let n=0;n<e;n++){const e=n-r,o=t[n]*e*e;o>a&&(i=n,a=o)}if(r>i){const t=r;r=i,i=t}if(i-r<=e/16)throw new T;let s=i-1,c=-1;for(let e=i-1;e>r;e--){const o=e-r,a=o*o*(i-e)*(n-t[e]);a>c&&(s=e,c=a)}return s<<R.LUMINANCE_SHIFT}}R.LUMINANCE_BITS=5,R.LUMINANCE_SHIFT=8-R.LUMINANCE_BITS,R.LUMINANCE_BUCKETS=1<<R.LUMINANCE_BITS,R.EMPTY=Uint8ClampedArray.from([0]);class N extends R{constructor(t){super(t),this.matrix=null}getBlackMatrix(){if(null!==this.matrix)return this.matrix;const t=this.getLuminanceSource(),e=t.getWidth(),n=t.getHeight();if(e>=N.MINIMUM_DIMENSION&&n>=N.MINIMUM_DIMENSION){const r=t.getMatrix();let o=e>>N.BLOCK_SIZE_POWER;0!==(e&N.BLOCK_SIZE_MASK)&&o++;let i=n>>N.BLOCK_SIZE_POWER;0!==(n&N.BLOCK_SIZE_MASK)&&i++;const a=N.calculateBlackPoints(r,o,i,e,n),s=new k(e,n);N.calculateThresholdForBlock(r,o,i,e,n,a,s),this.matrix=s}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(t){return new N(t)}static calculateThresholdForBlock(t,e,n,r,o,i,a){const s=o-N.BLOCK_SIZE,c=r-N.BLOCK_SIZE;for(let o=0;o<n;o++){let l=o<<N.BLOCK_SIZE_POWER;l>s&&(l=s);const d=N.cap(o,2,n-3);for(let n=0;n<e;n++){let o=n<<N.BLOCK_SIZE_POWER;o>c&&(o=c);const s=N.cap(n,2,e-3);let u=0;for(let t=-2;t<=2;t++){const e=i[d+t];u+=e[s-2]+e[s-1]+e[s]+e[s+1]+e[s+2]}const h=u/25;N.thresholdBlock(t,o,l,h,r,a)}}}static cap(t,e,n){return t<e?e:t>n?n:t}static thresholdBlock(t,e,n,r,o,i){for(let a=0,s=n*o+e;a<N.BLOCK_SIZE;a++,s+=o)for(let o=0;o<N.BLOCK_SIZE;o++)(255&t[s+o])<=r&&i.set(e+o,n+a)}static calculateBlackPoints(t,e,n,r,o){const i=o-N.BLOCK_SIZE,a=r-N.BLOCK_SIZE,s=new Array(n);for(let o=0;o<n;o++){s[o]=new Int32Array(e);let n=o<<N.BLOCK_SIZE_POWER;n>i&&(n=i);for(let i=0;i<e;i++){let e=i<<N.BLOCK_SIZE_POWER;e>a&&(e=a);let c=0,l=255,d=0;for(let o=0,i=n*r+e;o<N.BLOCK_SIZE;o++,i+=r){for(let e=0;e<N.BLOCK_SIZE;e++){const n=255&t[i+e];c+=n,n<l&&(l=n),n>d&&(d=n)}if(d-l>N.MIN_DYNAMIC_RANGE)for(o++,i+=r;o<N.BLOCK_SIZE;o++,i+=r)for(let e=0;e<N.BLOCK_SIZE;e++)c+=255&t[i+e]}let u=c>>2*N.BLOCK_SIZE_POWER;if(d-l<=N.MIN_DYNAMIC_RANGE&&(u=l/2,o>0&&i>0)){const t=(s[o-1][i]+2*s[o][i-1]+s[o-1][i-1])/4;l<t&&(u=t)}s[o][i]=u}}return s}}N.BLOCK_SIZE_POWER=3,N.BLOCK_SIZE=1<<N.BLOCK_SIZE_POWER,N.BLOCK_SIZE_MASK=N.BLOCK_SIZE-1,N.MINIMUM_DIMENSION=5*N.BLOCK_SIZE,N.MIN_DYNAMIC_RANGE=24;class D{constructor(t,e){this.width=t,this.height=e}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(t,e,n,r){throw new C("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new C("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new C("This luminance source does not support rotation by 45 degrees.")}toString(){const t=new Uint8ClampedArray(this.width);let e=new S;for(let n=0;n<this.height;n++){const r=this.getRow(n,t);for(let t=0;t<this.width;t++){const n=255&r[t];let o;o=n<64?"#":n<128?"+":n<192?".":" ",e.append(o)}e.append("\n")}return e.toString()}}class x extends D{constructor(t){super(t.getWidth(),t.getHeight()),this.delegate=t}getRow(t,e){const n=this.delegate.getRow(t,e),r=this.getWidth();for(let t=0;t<r;t++)n[t]=255-(255&n[t]);return n}getMatrix(){const t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(e);for(let r=0;r<e;r++)n[r]=255-(255&t[r]);return n}isCropSupported(){return this.delegate.isCropSupported()}crop(t,e,n,r){return new x(this.delegate.crop(t,e,n,r))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new x(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new x(this.delegate.rotateCounterClockwise45())}}class O extends D{constructor(t){super(t.width,t.height),this.canvas=t,this.tempCanvasElement=null,this.buffer=O.makeBufferFromCanvasImageData(t)}static makeBufferFromCanvasImageData(t){const e=t.getContext("2d").getImageData(0,0,t.width,t.height);return O.toGrayscaleBuffer(e.data,t.width,t.height)}static toGrayscaleBuffer(t,e,n){const r=new Uint8ClampedArray(e*n);for(let e=0,n=0,o=t.length;e<o;e+=4,n++){let o;o=0===t[e+3]?255:306*t[e]+601*t[e+1]+117*t[e+2]+512>>10,r[n]=o}return r}getRow(t,e){if(t<0||t>=this.getHeight())throw new d("Requested row is outside the image: "+t);const n=this.getWidth(),r=t*n;return null===e?e=this.buffer.slice(r,r+n):(e.length<n&&(e=new Uint8ClampedArray(n)),e.set(this.buffer.slice(r,r+n))),e}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(t,e,n,r){return super.crop(t,e,n,r),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(null===this.tempCanvasElement){const t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement}rotate(t){const e=this.getTempCanvasElement(),n=e.getContext("2d"),r=t*O.DEGREE_TO_RADIANS,o=this.canvas.width,i=this.canvas.height,a=Math.ceil(Math.abs(Math.cos(r))*o+Math.abs(Math.sin(r))*i),s=Math.ceil(Math.abs(Math.sin(r))*o+Math.abs(Math.cos(r))*i);return e.width=a,e.height=s,n.translate(a/2,s/2),n.rotate(r),n.drawImage(this.canvas,o/-2,i/-2),this.buffer=O.makeBufferFromCanvasImageData(e),this}invert(){return new x(this)}}O.DEGREE_TO_RADIANS=Math.PI/180;class M{constructor(t,e,n){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=n||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var P,B=(globalThis||commonjsGlobal||self||window?(globalThis||commonjsGlobal||self||window||void 0).__awaiter:void 0)||function(t,e,n,r){function o(t){return t instanceof n?t:new n(function(e){e(t)})}return new(n||(n=Promise))(function(n,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){t.done?n(t.value):o(t.value).then(a,s)}c((r=r.apply(t,e||[])).next())})};class F{constructor(t,e=500,n){this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return"undefined"!=typeof navigator}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!(!this.isMediaDevicesSuported||!navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(t){this._timeBetweenDecodingAttempts=t<0?0:t}set hints(t){this._hints=t||null}get hints(){return this._hints}listVideoInputDevices(){return B(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const t=yield navigator.mediaDevices.enumerateDevices(),e=[];for(const n of t){const t="video"===n.kind?"videoinput":n.kind;if("videoinput"!==t)continue;const r={deviceId:n.deviceId||n.id,label:n.label||`Video device ${e.length+1}`,kind:t,groupId:n.groupId};e.push(r)}return e})}getVideoInputDevices(){return B(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(t=>new M(t.deviceId,t.label))})}findDeviceById(t){return B(this,void 0,void 0,function*(){const e=yield this.listVideoInputDevices();return e?e.find(e=>e.deviceId===t):null})}decodeFromInputVideoDevice(t,e){return B(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(t,e)})}decodeOnceFromVideoDevice(t,e){return B(this,void 0,void 0,function*(){let n;this.reset(),n=t?{deviceId:{exact:t}}:{facingMode:"environment"};const r={video:n};return yield this.decodeOnceFromConstraints(r,e)})}decodeOnceFromConstraints(t,e){return B(this,void 0,void 0,function*(){const n=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeOnceFromStream(n,e)})}decodeOnceFromStream(t,e){return B(this,void 0,void 0,function*(){this.reset();const n=yield this.attachStreamToVideo(t,e);return yield this.decodeOnce(n)})}decodeFromInputVideoDeviceContinuously(t,e,n){return B(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(t,e,n)})}decodeFromVideoDevice(t,e,n){return B(this,void 0,void 0,function*(){let r;r=t?{deviceId:{exact:t}}:{facingMode:"environment"};const o={video:r};return yield this.decodeFromConstraints(o,e,n)})}decodeFromConstraints(t,e,n){return B(this,void 0,void 0,function*(){const r=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeFromStream(r,e,n)})}decodeFromStream(t,e,n){return B(this,void 0,void 0,function*(){this.reset();const r=yield this.attachStreamToVideo(t,e);return yield this.decodeContinuously(r,n)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(t,e){return B(this,void 0,void 0,function*(){const n=this.prepareVideoElement(e);return this.addVideoSource(n,t),this.videoElement=n,this.stream=t,yield this.playVideoOnLoadAsync(n),n})}playVideoOnLoadAsync(t){return new Promise((e,n)=>this.playVideoOnLoad(t,()=>e()))}playVideoOnLoad(t,e){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(t),t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)}isVideoPlaying(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2}tryPlayVideo(t){return B(this,void 0,void 0,function*(){if(this.isVideoPlaying(t))console.warn("Trying to play video that is already playing.");else try{yield t.play()}catch(t){console.warn("It was not possible to play the video.")}})}getMediaElement(t,e){const n=document.getElementById(t);if(!n)throw new l(`element with id '${t}' not found`);if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new l(`element with id '${t}' must be an ${e} element`);return n}decodeFromImage(t,e){if(!t&&!e)throw new l("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)}decodeFromVideo(t,e){if(!t&&!e)throw new l("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)}decodeFromVideoContinuously(t,e,n){if(void 0===t&&void 0===e)throw new l("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)}decodeFromImageElement(t){if(!t)throw new l("An image element must be provided.");this.reset();const e=this.prepareImageElement(t);let n;return this.imageElement=e,n=this.isImageLoaded(e)?this.decodeOnce(e,!1,!0):this._decodeOnLoadImage(e),n}decodeFromVideoElement(t){const e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)}decodeFromVideoElementContinuously(t,e){const n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)}_decodeFromVideoElementSetup(t){if(!t)throw new l("A video element must be provided.");this.reset();const e=this.prepareVideoElement(t);return this.videoElement=e,e}decodeFromImageUrl(t){if(!t)throw new l("An URL must be provided.");this.reset();const e=this.prepareImageElement();this.imageElement=e;const n=this._decodeOnLoadImage(e);return e.src=t,n}decodeFromVideoUrl(t){if(!t)throw new l("An URL must be provided.");this.reset();const e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n}decodeFromVideoUrlContinuously(t,e){if(!t)throw new l("An URL must be provided.");this.reset();const n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,e);return n.src=t,r}_decodeOnLoadImage(t){return new Promise((e,n)=>{this.imageLoadedListener=()=>this.decodeOnce(t,!1,!0).then(e,n),t.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(t){return B(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(t),yield this.decodeOnce(t)})}_decodeOnLoadVideoContinuously(t,e){return B(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(t),this.decodeContinuously(t,e)})}isImageLoaded(t){return!!t.complete&&0!==t.naturalWidth}prepareImageElement(t){let e;return void 0===t&&(e=document.createElement("img"),e.width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e}prepareVideoElement(t){let e;return t||"undefined"==typeof document||(e=document.createElement("video"),e.width=200,e.height=200),"string"==typeof t&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e}decodeOnce(t,e=!0,n=!0){this._stopAsyncDecode=!1;const r=(o,i)=>{if(this._stopAsyncDecode)return i(new T("Video stream has ended before any code could be detected.")),void(this._stopAsyncDecode=void 0);try{o(this.decode(t))}catch(t){if(e&&t instanceof T||(t instanceof h||t instanceof v)&&n)return setTimeout(r,this._timeBetweenDecodingAttempts,o,i);i(t)}};return new Promise((t,e)=>r(t,e))}decodeContinuously(t,e){this._stopContinuousDecode=!1;const n=()=>{if(this._stopContinuousDecode)this._stopContinuousDecode=void 0;else try{const r=this.decode(t);e(r,null),setTimeout(n,this.timeBetweenScansMillis)}catch(t){e(null,t),(t instanceof h||t instanceof v||t instanceof T)&&setTimeout(n,this._timeBetweenDecodingAttempts)}};n()}decode(t){const e=this.createBinaryBitmap(t);return this.decodeBitmap(e)}_isHTMLVideoElement(t){return 0!==t.videoWidth}drawFrameOnCanvas(t,e,n){e||(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n||(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}drawImageOnCanvas(t,e,n=this.captureCanvasContext){e||(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n||(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}createBinaryBitmap(t){this.getCaptureCanvasContext(t),this._isHTMLVideoElement(t)?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);const e=this.getCaptureCanvas(t),n=new O(e),r=new N(n);return new u(r)}getCaptureCanvasContext(t){if(!this.captureCanvasContext){const e=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=e}return this.captureCanvasContext}getCaptureCanvas(t){if(!this.captureCanvas){const e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas}decodeBitmap(t){return this.reader.decode(t,this._hints)}createCaptureCanvas(t){if("undefined"==typeof document)return this._destroyCaptureCanvas(),null;const e=document.createElement("canvas");let n,r;return void 0!==t&&(t instanceof HTMLVideoElement?(n=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=r+"px",e.width=n,e.height=r,e}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(t=>t.stop()),this.stream=void 0),!1===this._stopAsyncDecode&&this.stopAsyncDecode(),!1===this._stopContinuousDecode&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(void 0!==this.videoEndedListener&&this.videoElement.removeEventListener("ended",this.videoEndedListener),void 0!==this.videoPlayingEventListener&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),void 0!==this.videoCanPlayListener&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(void 0!==this.imageLoadedListener&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(t,e){try{t.srcObject=e}catch(n){t.src=URL.createObjectURL(e)}}cleanVideoSource(t){try{t.srcObject=null}catch(e){t.src=""}this.videoElement.removeAttribute("src")}}class L{constructor(t,e,n=(null==e?0:8*e.length),r,o,i=f.currentTimeMillis()){this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=r,this.format=o,this.timestamp=i,this.text=t,this.rawBytes=e,this.numBits=null==n?null==e?0:8*e.length:n,this.resultPoints=r,this.format=o,this.resultMetadata=null,this.timestamp=null==i?f.currentTimeMillis():i}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(t,e){null===this.resultMetadata&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)}putAllMetadata(t){null!==t&&(null===this.resultMetadata?this.resultMetadata=t:this.resultMetadata=new Map(t))}addResultPoints(t){const e=this.resultPoints;if(null===e)this.resultPoints=t;else if(null!==t&&t.length>0){const n=new Array(e.length+t.length);f.arraycopy(e,0,n,0,e.length),f.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}}getTimestamp(){return this.timestamp}toString(){return this.text}}!function(t){t[t.AZTEC=0]="AZTEC",t[t.CODABAR=1]="CODABAR",t[t.CODE_39=2]="CODE_39",t[t.CODE_93=3]="CODE_93",t[t.CODE_128=4]="CODE_128",t[t.DATA_MATRIX=5]="DATA_MATRIX",t[t.EAN_8=6]="EAN_8",t[t.EAN_13=7]="EAN_13",t[t.ITF=8]="ITF",t[t.MAXICODE=9]="MAXICODE",t[t.PDF_417=10]="PDF_417",t[t.QR_CODE=11]="QR_CODE",t[t.RSS_14=12]="RSS_14",t[t.RSS_EXPANDED=13]="RSS_EXPANDED",t[t.UPC_A=14]="UPC_A",t[t.UPC_E=15]="UPC_E",t[t.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"}(P||(P={}));var q,V=P;!function(t){t[t.OTHER=0]="OTHER",t[t.ORIENTATION=1]="ORIENTATION",t[t.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",t[t.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",t[t.ISSUE_NUMBER=4]="ISSUE_NUMBER",t[t.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",t[t.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",t[t.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",t[t.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",t[t.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",t[t.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"}(q||(q={}));var H,U,z,W,j,G,X=q;class Q{constructor(t,e,n,r,o=-1,i=-1){this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=o,this.structuredAppendParity=i,this.numBits=null==t?0:8*t.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(t){this.numBits=t}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(t){this.errorsCorrected=t}getErasures(){return this.erasures}setErasures(t){this.erasures=t}getOther(){return this.other}setOther(t){this.other=t}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class Y{exp(t){return this.expTable[t]}log(t){if(0===t)throw new d;return this.logTable[t]}static addOrSubtract(t,e){return t^e}}class Z{constructor(t,e){if(0===e.length)throw new d;this.field=t;const n=e.length;if(n>1&&0===e[0]){let t=1;for(;t<n&&0===e[t];)t++;t===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-t),f.arraycopy(e,t,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(0===t)return this.getCoefficient(0);const e=this.coefficients;let n;if(1===t){n=0;for(let t=0,r=e.length;t!==r;t++){const r=e[t];n=Y.addOrSubtract(n,r)}return n}n=e[0];const r=e.length,o=this.field;for(let i=1;i<r;i++)n=Y.addOrSubtract(o.multiply(t,n),e[i]);return n}addOrSubtract(t){if(!this.field.equals(t.field))throw new d("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;let e=this.coefficients,n=t.coefficients;if(e.length>n.length){const t=e;e=n,n=t}let r=new Int32Array(n.length);const o=n.length-e.length;f.arraycopy(n,0,r,0,o);for(let t=o;t<n.length;t++)r[t]=Y.addOrSubtract(e[t-o],n[t]);return new Z(this.field,r)}multiply(t){if(!this.field.equals(t.field))throw new d("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();const e=this.coefficients,n=e.length,r=t.coefficients,o=r.length,i=new Int32Array(n+o-1),a=this.field;for(let t=0;t<n;t++){const n=e[t];for(let e=0;e<o;e++)i[t+e]=Y.addOrSubtract(i[t+e],a.multiply(n,r[e]))}return new Z(a,i)}multiplyScalar(t){if(0===t)return this.field.getZero();if(1===t)return this;const e=this.coefficients.length,n=this.field,r=new Int32Array(e),o=this.coefficients;for(let i=0;i<e;i++)r[i]=n.multiply(o[i],t);return new Z(n,r)}multiplyByMonomial(t,e){if(t<0)throw new d;if(0===e)return this.field.getZero();const n=this.coefficients,r=n.length,o=new Int32Array(r+t),i=this.field;for(let t=0;t<r;t++)o[t]=i.multiply(n[t],e);return new Z(i,o)}divide(t){if(!this.field.equals(t.field))throw new d("GenericGFPolys do not have same GenericGF field");if(t.isZero())throw new d("Divide by 0");const e=this.field;let n=e.getZero(),r=this;const o=t.getCoefficient(t.getDegree()),i=e.inverse(o);for(;r.getDegree()>=t.getDegree()&&!r.isZero();){const o=r.getDegree()-t.getDegree(),a=e.multiply(r.getCoefficient(r.getDegree()),i),s=t.multiplyByMonomial(o,a),c=e.buildMonomial(o,a);n=n.addOrSubtract(c),r=r.addOrSubtract(s)}return[n,r]}toString(){let t="";for(let e=this.getDegree();e>=0;e--){let n=this.getCoefficient(e);if(0!==n){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),0===e||1!==n){const e=this.field.log(n);0===e?t+="1":1===e?t+="a":(t+="a^",t+=e)}0!==e&&(1===e?t+="x":(t+="x^",t+=e))}}return t}}class K extends c{}K.kind="ArithmeticException";class J extends Y{constructor(t,e,n){super(),this.primitive=t,this.size=e,this.generatorBase=n;const r=new Int32Array(e);let o=1;for(let n=0;n<e;n++)r[n]=o,o*=2,o>=e&&(o^=t,o&=e-1);this.expTable=r;const i=new Int32Array(e);for(let t=0;t<e-1;t++)i[r[t]]=t;this.logTable=i,this.zero=new Z(this,Int32Array.from([0])),this.one=new Z(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,e){if(t<0)throw new d;if(0===e)return this.zero;const n=new Int32Array(t+1);return n[0]=e,new Z(this,n)}inverse(t){if(0===t)throw new K;return this.expTable[this.size-this.logTable[t]-1]}multiply(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+w.toHexString(this.primitive)+","+this.size+")"}equals(t){return t===this}}J.AZTEC_DATA_12=new J(4201,4096,1),J.AZTEC_DATA_10=new J(1033,1024,1),J.AZTEC_DATA_6=new J(67,64,1),J.AZTEC_PARAM=new J(19,16,1),J.QR_CODE_FIELD_256=new J(285,256,0),J.DATA_MATRIX_FIELD_256=new J(301,256,1),J.AZTEC_DATA_8=J.DATA_MATRIX_FIELD_256,J.MAXICODE_FIELD_64=J.AZTEC_DATA_6;class tt extends c{}tt.kind="ReedSolomonException";class et extends c{}et.kind="IllegalStateException";class nt{constructor(t){this.field=t}decode(t,e){const n=this.field,r=new Z(n,t),o=new Int32Array(e);let i=!0;for(let t=0;t<e;t++){const e=r.evaluateAt(n.exp(t+n.getGeneratorBase()));o[o.length-1-t]=e,0!==e&&(i=!1)}if(i)return;const a=new Z(n,o),s=this.runEuclideanAlgorithm(n.buildMonomial(e,1),a,e),c=s[0],l=s[1],d=this.findErrorLocations(c),u=this.findErrorMagnitudes(l,d);for(let e=0;e<d.length;e++){const r=t.length-1-n.log(d[e]);if(r<0)throw new tt("Bad error location");t[r]=J.addOrSubtract(t[r],u[e])}}runEuclideanAlgorithm(t,e,n){if(t.getDegree()<e.getDegree()){const n=t;t=e,e=n}const r=this.field;let o=t,i=e,a=r.getZero(),s=r.getOne();for(;i.getDegree()>=(n/2|0);){let t=o,e=a;if(o=i,a=s,o.isZero())throw new tt("r_{i-1} was zero");i=t;let n=r.getZero();const c=o.getCoefficient(o.getDegree()),l=r.inverse(c);for(;i.getDegree()>=o.getDegree()&&!i.isZero();){const t=i.getDegree()-o.getDegree(),e=r.multiply(i.getCoefficient(i.getDegree()),l);n=n.addOrSubtract(r.buildMonomial(t,e)),i=i.addOrSubtract(o.multiplyByMonomial(t,e))}if(s=n.multiply(a).addOrSubtract(e),i.getDegree()>=o.getDegree())throw new et("Division algorithm failed to reduce polynomial?")}const c=s.getCoefficient(0);if(0===c)throw new tt("sigmaTilde(0) was zero");const l=r.inverse(c);return[s.multiplyScalar(l),i.multiplyScalar(l)]}findErrorLocations(t){const e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);const n=new Int32Array(e);let r=0;const o=this.field;for(let i=1;i<o.getSize()&&r<e;i++)0===t.evaluateAt(i)&&(n[r]=o.inverse(i),r++);if(r!==e)throw new tt("Error locator degree does not match number of roots");return n}findErrorMagnitudes(t,e){const n=e.length,r=new Int32Array(n),o=this.field;for(let i=0;i<n;i++){const a=o.inverse(e[i]);let s=1;for(let t=0;t<n;t++)if(i!==t){const n=o.multiply(e[t],a),r=1&n?-2&n:1|n;s=o.multiply(s,r)}r[i]=o.multiply(t.evaluateAt(a),o.inverse(s)),0!==o.getGeneratorBase()&&(r[i]=o.multiply(r[i],a))}return r}}!function(t){t[t.UPPER=0]="UPPER",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.DIGIT=3]="DIGIT",t[t.PUNCT=4]="PUNCT",t[t.BINARY=5]="BINARY"}(H||(H={}));class rt{decode(t){this.ddata=t;let e=t.getBits(),n=this.extractBits(e),r=this.correctBits(n),o=rt.convertBoolArrayToByteArray(r),i=rt.getEncodedData(r),a=new Q(o,i,null,null);return a.setNumBits(r.length),a}static highLevelDecode(t){return this.getEncodedData(t)}static getEncodedData(t){let e=t.length,n=H.UPPER,r=H.UPPER,o="",i=0;for(;i<e;)if(r===H.BINARY){if(e-i<5)break;let a=rt.readCode(t,i,5);if(i+=5,0===a){if(e-i<11)break;a=rt.readCode(t,i,11)+31,i+=11}for(let n=0;n<a;n++){if(e-i<8){i=e;break}const n=rt.readCode(t,i,8);o+=A.castAsNonUtf8Char(n),i+=8}r=n}else{let a=r===H.DIGIT?4:5;if(e-i<a)break;let s=rt.readCode(t,i,a);i+=a;let c=rt.getCharacter(r,s);c.startsWith("CTRL_")?(n=r,r=rt.getTable(c.charAt(5)),"L"===c.charAt(6)&&(n=r)):(o+=c,r=n)}return o}static getTable(t){switch(t){case"L":return H.LOWER;case"P":return H.PUNCT;case"M":return H.MIXED;case"D":return H.DIGIT;case"B":return H.BINARY;default:return H.UPPER}}static getCharacter(t,e){switch(t){case H.UPPER:return rt.UPPER_TABLE[e];case H.LOWER:return rt.LOWER_TABLE[e];case H.MIXED:return rt.MIXED_TABLE[e];case H.PUNCT:return rt.PUNCT_TABLE[e];case H.DIGIT:return rt.DIGIT_TABLE[e];default:throw new et("Bad table")}}correctBits(t){let e,n;this.ddata.getNbLayers()<=2?(n=6,e=J.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=J.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=J.AZTEC_DATA_10):(n=12,e=J.AZTEC_DATA_12);let r=this.ddata.getNbDatablocks(),o=t.length/n;if(o<r)throw new v;let i=t.length%n,a=new Int32Array(o);for(let e=0;e<o;e++,i+=n)a[e]=rt.readCode(t,i,n);try{new nt(e).decode(a,o-r)}catch(t){throw new v(t)}let s=(1<<n)-1,c=0;for(let t=0;t<r;t++){let e=a[t];if(0===e||e===s)throw new v;1!==e&&e!==s-1||c++}let l=new Array(r*n-c),d=0;for(let t=0;t<r;t++){let e=a[t];if(1===e||e===s-1)l.fill(e>1,d,d+n-1),d+=n-1;else for(let t=n-1;t>=0;--t)l[d++]=!!(e&1<<t)}return l}extractBits(t){let e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(e?11:14)+4*n,o=new Int32Array(r),i=new Array(this.totalBitsInLayer(n,e));if(e)for(let t=0;t<o.length;t++)o[t]=t;else{let t=r+1+2*w.truncDivision(w.truncDivision(r,2)-1,15),e=r/2,n=w.truncDivision(t,2);for(let t=0;t<e;t++){let r=t+w.truncDivision(t,15);o[e-t-1]=n-r-1,o[e+t]=n+r+1}}for(let a=0,s=0;a<n;a++){let c=4*(n-a)+(e?9:12),l=2*a,d=r-1-l;for(let e=0;e<c;e++){let n=2*e;for(let r=0;r<2;r++)i[s+n+r]=t.get(o[l+r],o[l+e]),i[s+2*c+n+r]=t.get(o[l+e],o[d-r]),i[s+4*c+n+r]=t.get(o[d-r],o[d-e]),i[s+6*c+n+r]=t.get(o[d-e],o[l+r])}s+=8*c}return i}static readCode(t,e,n){let r=0;for(let o=e;o<e+n;o++)r<<=1,t[o]&&(r|=1);return r}static readByte(t,e){let n=t.length-e;return n>=8?rt.readCode(t,e,8):rt.readCode(t,e,n)<<8-n}static convertBoolArrayToByteArray(t){let e=new Uint8Array((t.length+7)/8);for(let n=0;n<e.length;n++)e[n]=rt.readByte(t,8*n);return e}totalBitsInLayer(t,e){return((e?88:112)+16*t)*t}}rt.UPPER_TABLE=["CTRL_PS"," ","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],rt.LOWER_TABLE=["CTRL_PS"," ","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],rt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b","\t","\n","\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],rt.PUNCT_TABLE=["","\r","\r\n",". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],rt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class ot{constructor(){}static round(t){return NaN===t?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0}static distance(t,e,n,r){const o=t-n,i=e-r;return Math.sqrt(o*o+i*i)}static sum(t){let e=0;for(let n=0,r=t.length;n!==r;n++)e+=t[n];return e}}class it{static floatToIntBits(t){return t}}it.MAX_VALUE=Number.MAX_SAFE_INTEGER;class at{constructor(t,e){this.x=t,this.y=e}getX(){return this.x}getY(){return this.y}equals(t){if(t instanceof at){const e=t;return this.x===e.x&&this.y===e.y}return!1}hashCode(){return 31*it.floatToIntBits(this.x)+it.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(t){const e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),r=this.distance(t[0],t[2]);let o,i,a;if(n>=e&&n>=r?(i=t[0],o=t[1],a=t[2]):r>=n&&r>=e?(i=t[1],o=t[0],a=t[2]):(i=t[2],o=t[0],a=t[1]),this.crossProductZ(o,i,a)<0){const t=o;o=a,a=t}t[0]=o,t[1]=i,t[2]=a}static distance(t,e){return ot.distance(t.x,t.y,e.x,e.y)}static crossProductZ(t,e,n){const r=e.x,o=e.y;return(n.x-r)*(t.y-o)-(n.y-o)*(t.x-r)}}class st{constructor(t,e){this.bits=t,this.points=e}getBits(){return this.bits}getPoints(){return this.points}}class ct extends st{constructor(t,e,n,r,o){super(t,e),this.compact=n,this.nbDatablocks=r,this.nbLayers=o}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class lt{constructor(t,e,n,r){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),null==e&&(e=lt.INIT_SIZE),null==n&&(n=t.getWidth()/2|0),null==r&&(r=t.getHeight()/2|0);const o=e/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=r-o,this.downInit=r+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new T}detect(){let t=this.leftInit,e=this.rightInit,n=this.upInit,r=this.downInit,o=!1,i=!0,a=!1,s=!1,c=!1,l=!1,d=!1;const u=this.width,h=this.height;for(;i;){i=!1;let m=!0;for(;(m||!s)&&e<u;)m=this.containsBlackPoint(n,r,e,!1),m?(e++,i=!0,s=!0):s||e++;if(e>=u){o=!0;break}let f=!0;for(;(f||!c)&&r<h;)f=this.containsBlackPoint(t,e,r,!0),f?(r++,i=!0,c=!0):c||r++;if(r>=h){o=!0;break}let p=!0;for(;(p||!l)&&t>=0;)p=this.containsBlackPoint(n,r,t,!1),p?(t--,i=!0,l=!0):l||t--;if(t<0){o=!0;break}let _=!0;for(;(_||!d)&&n>=0;)_=this.containsBlackPoint(t,e,n,!0),_?(n--,i=!0,d=!0):d||n--;if(n<0){o=!0;break}i&&(a=!0)}if(!o&&a){const o=e-t;let i=null;for(let e=1;null===i&&e<o;e++)i=this.getBlackPointOnSegment(t,r-e,t+e,r);if(null==i)throw new T;let a=null;for(let e=1;null===a&&e<o;e++)a=this.getBlackPointOnSegment(t,n+e,t+e,n);if(null==a)throw new T;let s=null;for(let t=1;null===s&&t<o;t++)s=this.getBlackPointOnSegment(e,n+t,e-t,n);if(null==s)throw new T;let c=null;for(let t=1;null===c&&t<o;t++)c=this.getBlackPointOnSegment(e,r-t,e-t,r);if(null==c)throw new T;return this.centerEdges(c,i,s,a)}throw new T}getBlackPointOnSegment(t,e,n,r){const o=ot.round(ot.distance(t,e,n,r)),i=(n-t)/o,a=(r-e)/o,s=this.image;for(let n=0;n<o;n++){const r=ot.round(t+n*i),o=ot.round(e+n*a);if(s.get(r,o))return new at(r,o)}return null}centerEdges(t,e,n,r){const o=t.getX(),i=t.getY(),a=e.getX(),s=e.getY(),c=n.getX(),l=n.getY(),d=r.getX(),u=r.getY(),h=lt.CORR;return o<this.width/2?[new at(d-h,u+h),new at(a+h,s+h),new at(c-h,l-h),new at(o+h,i-h)]:[new at(d+h,u+h),new at(a+h,s-h),new at(c-h,l+h),new at(o-h,i-h)]}containsBlackPoint(t,e,n,r){const o=this.image;if(r){for(let r=t;r<=e;r++)if(o.get(r,n))return!0}else for(let r=t;r<=e;r++)if(o.get(n,r))return!0;return!1}}lt.INIT_SIZE=10,lt.CORR=1;class dt{static checkAndNudgePoints(t,e){const n=t.getWidth(),r=t.getHeight();let o=!0;for(let t=0;t<e.length&&o;t+=2){const i=Math.floor(e[t]),a=Math.floor(e[t+1]);if(i<-1||i>n||a<-1||a>r)throw new T;o=!1,-1===i?(e[t]=0,o=!0):i===n&&(e[t]=n-1,o=!0),-1===a?(e[t+1]=0,o=!0):a===r&&(e[t+1]=r-1,o=!0)}o=!0;for(let t=e.length-2;t>=0&&o;t-=2){const i=Math.floor(e[t]),a=Math.floor(e[t+1]);if(i<-1||i>n||a<-1||a>r)throw new T;o=!1,-1===i?(e[t]=0,o=!0):i===n&&(e[t]=n-1,o=!0),-1===a?(e[t+1]=0,o=!0):a===r&&(e[t+1]=r-1,o=!0)}}}class ut{constructor(t,e,n,r,o,i,a,s,c){this.a11=t,this.a21=e,this.a31=n,this.a12=r,this.a22=o,this.a32=i,this.a13=a,this.a23=s,this.a33=c}static quadrilateralToQuadrilateral(t,e,n,r,o,i,a,s,c,l,d,u,h,m,f,p){const _=ut.quadrilateralToSquare(t,e,n,r,o,i,a,s);return ut.squareToQuadrilateral(c,l,d,u,h,m,f,p).times(_)}transformPoints(t){const e=t.length,n=this.a11,r=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,c=this.a31,l=this.a32,d=this.a33;for(let u=0;u<e;u+=2){const e=t[u],h=t[u+1],m=o*e+s*h+d;t[u]=(n*e+i*h+c)/m,t[u+1]=(r*e+a*h+l)/m}}transformPointsWithValues(t,e){const n=this.a11,r=this.a12,o=this.a13,i=this.a21,a=this.a22,s=this.a23,c=this.a31,l=this.a32,d=this.a33,u=t.length;for(let h=0;h<u;h++){const u=t[h],m=e[h],f=o*u+s*m+d;t[h]=(n*u+i*m+c)/f,e[h]=(r*u+a*m+l)/f}}static squareToQuadrilateral(t,e,n,r,o,i,a,s){const c=t-n+o-a,l=e-r+i-s;if(0===c&&0===l)return new ut(n-t,o-n,t,r-e,i-r,e,0,0,1);{const d=n-o,u=a-o,h=r-i,m=s-i,f=d*m-u*h,p=(c*m-u*l)/f,_=(d*l-c*h)/f;return new ut(n-t+p*n,a-t+_*a,t,r-e+p*r,s-e+_*s,e,p,_,1)}}static quadrilateralToSquare(t,e,n,r,o,i,a,s){return ut.squareToQuadrilateral(t,e,n,r,o,i,a,s).buildAdjoint()}buildAdjoint(){return new ut(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(t){return new ut(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)}}class ht extends dt{sampleGrid(t,e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w){const $=ut.quadrilateralToQuadrilateral(r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w);return this.sampleGridWithTransform(t,e,n,$)}sampleGridWithTransform(t,e,n,r){if(e<=0||n<=0)throw new T;const o=new k(e,n),i=new Float32Array(2*e);for(let e=0;e<n;e++){const n=i.length,a=e+.5;for(let t=0;t<n;t+=2)i[t]=t/2+.5,i[t+1]=a;r.transformPoints(i),dt.checkAndNudgePoints(t,i);try{for(let r=0;r<n;r+=2)t.get(Math.floor(i[r]),Math.floor(i[r+1]))&&o.set(r/2,e)}catch(t){throw new T}}return o}}class mt{static setGridSampler(t){mt.gridSampler=t}static getInstance(){return mt.gridSampler}}mt.gridSampler=new ht;class ft{constructor(t,e){this.x=t,this.y=e}toResultPoint(){return new at(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class pt{constructor(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}detect(){return this.detectMirror(!1)}detectMirror(t){let e=this.getMatrixCenter(),n=this.getBullsEyeCorners(e);if(t){let t=n[0];n[0]=n[2],n[2]=t}this.extractParameters(n);let r=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),o=this.getMatrixCornerPoints(n);return new ct(r,o,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(t){if(!(this.isValidPoint(t[0])&&this.isValidPoint(t[1])&&this.isValidPoint(t[2])&&this.isValidPoint(t[3])))throw new T;let e=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(n,e);let r=0;for(let t=0;t<4;t++){let e=n[(this.shift+t)%4];this.compact?(r<<=7,r+=e>>1&127):(r<<=10,r+=(e>>2&992)+(e>>1&31))}let o=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=1+(o>>6),this.nbDataBlocks=1+(63&o)):(this.nbLayers=1+(o>>11),this.nbDataBlocks=1+(2047&o))}getRotation(t,e){let n=0;t.forEach((t,r,o)=>{n=(t>>e-2<<1)+(1&t)+(n<<3)}),n=((1&n)<<11)+(n>>1);for(let t=0;t<4;t++)if(w.bitCount(n^this.EXPECTED_CORNER_BITS[t])<=2)return t;throw new T}getCorrectedParameterData(t,e){let n,r;e?(n=7,r=2):(n=10,r=4);let o=n-r,i=new Int32Array(n);for(let e=n-1;e>=0;--e)i[e]=15&t,t>>=4;try{new nt(J.AZTEC_PARAM).decode(i,o)}catch(t){throw new T}let a=0;for(let t=0;t<r;t++)a=(a<<4)+i[t];return a}getBullsEyeCorners(t){let e=t,n=t,r=t,o=t,i=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let t=this.getFirstDifferent(e,i,1,-1),a=this.getFirstDifferent(n,i,1,1),s=this.getFirstDifferent(r,i,-1,1),c=this.getFirstDifferent(o,i,-1,-1);if(this.nbCenterLayers>2){let n=this.distancePoint(c,t)*this.nbCenterLayers/(this.distancePoint(o,e)*(this.nbCenterLayers+2));if(n<.75||n>1.25||!this.isWhiteOrBlackRectangle(t,a,s,c))break}e=t,n=a,r=s,o=c,i=!i}if(5!==this.nbCenterLayers&&7!==this.nbCenterLayers)throw new T;this.compact=5===this.nbCenterLayers;let a=new at(e.getX()+.5,e.getY()-.5),s=new at(n.getX()+.5,n.getY()+.5),c=new at(r.getX()-.5,r.getY()+.5),l=new at(o.getX()-.5,o.getY()-.5);return this.expandSquare([a,s,c,l],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let t,e,n,r;try{let o=new lt(this.image).detect();t=o[0],e=o[1],n=o[2],r=o[3]}catch(o){let i=this.image.getWidth()/2,a=this.image.getHeight()/2;t=this.getFirstDifferent(new ft(i+7,a-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new ft(i+7,a+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new ft(i-7,a+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new ft(i-7,a-7),!1,-1,-1).toResultPoint()}let o=ot.round((t.getX()+r.getX()+e.getX()+n.getX())/4),i=ot.round((t.getY()+r.getY()+e.getY()+n.getY())/4);try{let a=new lt(this.image,15,o,i).detect();t=a[0],e=a[1],n=a[2],r=a[3]}catch(a){t=this.getFirstDifferent(new ft(o+7,i-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new ft(o+7,i+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new ft(o-7,i+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new ft(o-7,i-7),!1,-1,-1).toResultPoint()}return o=ot.round((t.getX()+r.getX()+e.getX()+n.getX())/4),i=ot.round((t.getY()+r.getY()+e.getY()+n.getY())/4),new ft(o,i)}getMatrixCornerPoints(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())}sampleGrid(t,e,n,r,o){let i=mt.getInstance(),a=this.getDimension(),s=a/2-this.nbCenterLayers,c=a/2+this.nbCenterLayers;return i.sampleGrid(t,a,a,s,s,c,s,c,c,s,c,e.getX(),e.getY(),n.getX(),n.getY(),r.getX(),r.getY(),o.getX(),o.getY())}sampleLine(t,e,n){let r=0,o=this.distanceResultPoint(t,e),i=o/n,a=t.getX(),s=t.getY(),c=i*(e.getX()-t.getX())/o,l=i*(e.getY()-t.getY())/o;for(let t=0;t<n;t++)this.image.get(ot.round(a+t*c),ot.round(s+t*l))&&(r|=1<<n-t-1);return r}isWhiteOrBlackRectangle(t,e,n,r){let o=3;t=new ft(t.getX()-o,t.getY()+o),e=new ft(e.getX()-o,e.getY()-o),n=new ft(n.getX()+o,n.getY()-o),r=new ft(r.getX()+o,r.getY()+o);let i=this.getColor(r,t);if(0===i)return!1;let a=this.getColor(t,e);return a===i&&(a=this.getColor(e,n),a===i&&(a=this.getColor(n,r),a===i))}getColor(t,e){let n=this.distancePoint(t,e),r=(e.getX()-t.getX())/n,o=(e.getY()-t.getY())/n,i=0,a=t.getX(),s=t.getY(),c=this.image.get(t.getX(),t.getY()),l=Math.ceil(n);for(let t=0;t<l;t++)a+=r,s+=o,this.image.get(ot.round(a),ot.round(s))!==c&&i++;let d=i/n;return d>.1&&d<.9?0:d<=.1===c?1:-1}getFirstDifferent(t,e,n,r){let o=t.getX()+n,i=t.getY()+r;for(;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=n,i+=r;for(o-=n,i-=r;this.isValid(o,i)&&this.image.get(o,i)===e;)o+=n;for(o-=n;this.isValid(o,i)&&this.image.get(o,i)===e;)i+=r;return i-=r,new ft(o,i)}expandSquare(t,e,n){let r=n/(2*e),o=t[0].getX()-t[2].getX(),i=t[0].getY()-t[2].getY(),a=(t[0].getX()+t[2].getX())/2,s=(t[0].getY()+t[2].getY())/2,c=new at(a+r*o,s+r*i),l=new at(a-r*o,s-r*i);return o=t[1].getX()-t[3].getX(),i=t[1].getY()-t[3].getY(),a=(t[1].getX()+t[3].getX())/2,s=(t[1].getY()+t[3].getY())/2,[c,new at(a+r*o,s+r*i),l,new at(a-r*o,s-r*i)]}isValid(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()}isValidPoint(t){let e=ot.round(t.getX()),n=ot.round(t.getY());return this.isValid(e,n)}distancePoint(t,e){return ot.distance(t.getX(),t.getY(),e.getX(),e.getY())}distanceResultPoint(t,e){return ot.distance(t.getX(),t.getY(),e.getX(),e.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(w.truncDivision(this.nbLayers-4,8)+1)+15}}class _t{decode(t,e=null){let n=null,r=new pt(t.getBlackMatrix()),o=null,i=null;try{let t=r.detectMirror(!1);o=t.getPoints(),this.reportFoundResultPoints(e,o),i=(new rt).decode(t)}catch(t){n=t}if(null==i)try{let t=r.detectMirror(!0);o=t.getPoints(),this.reportFoundResultPoints(e,o),i=(new rt).decode(t)}catch(t){if(null!=n)throw n;throw t}let a=new L(i.getText(),i.getRawBytes(),i.getNumBits(),o,V.AZTEC,f.currentTimeMillis()),s=i.getByteSegments();null!=s&&a.putMetadata(X.BYTE_SEGMENTS,s);let c=i.getECLevel();return null!=c&&a.putMetadata(X.ERROR_CORRECTION_LEVEL,c),a}reportFoundResultPoints(t,e){if(null!=t){let n=t.get(b.NEED_RESULT_POINT_CALLBACK);null!=n&&e.forEach((t,e,r)=>{n.foundPossibleResultPoint(t)})}}reset(){}}class gt extends F{constructor(t=500){super(new _t,t)}}class wt{decode(t,e){try{return this.doDecode(t,e)}catch(n){if(e&&!0===e.get(b.TRY_HARDER)&&t.isRotateSupported()){const n=t.rotateCounterClockwise(),r=this.doDecode(n,e),o=r.getResultMetadata();let i=270;null!==o&&!0===o.get(X.ORIENTATION)&&(i+=o.get(X.ORIENTATION)%360),r.putMetadata(X.ORIENTATION,i);const a=r.getResultPoints();if(null!==a){const t=n.getHeight();for(let e=0;e<a.length;e++)a[e]=new at(t-a[e].getY()-1,a[e].getX())}return r}throw new T}}reset(){}doDecode(t,e){const n=t.getWidth(),r=t.getHeight();let o=new $(n);const i=e&&!0===e.get(b.TRY_HARDER),a=Math.max(1,r>>(i?8:5));let s;s=i?r:15;const c=Math.trunc(r/2);for(let i=0;i<s;i++){const s=Math.trunc((i+1)/2),l=c+a*(1&i?-s:s);if(l<0||l>=r)break;try{o=t.getBlackRow(l,o)}catch(t){continue}for(let t=0;t<2;t++){if(1===t&&(o.reverse(),e&&!0===e.get(b.NEED_RESULT_POINT_CALLBACK))){const t=new Map;e.forEach((e,n)=>t.set(n,e)),t.delete(b.NEED_RESULT_POINT_CALLBACK),e=t}try{const r=this.decodeRow(l,o,e);if(1===t){r.putMetadata(X.ORIENTATION,180);const t=r.getResultPoints();null!==t&&(t[0]=new at(n-t[0].getX()-1,t[0].getY()),t[1]=new at(n-t[1].getX()-1,t[1].getY()))}return r}catch(t){}}}throw new T}static recordPattern(t,e,n){const r=n.length;for(let t=0;t<r;t++)n[t]=0;const o=t.getSize();if(e>=o)throw new T;let i=!t.get(e),a=0,s=e;for(;s<o;){if(t.get(s)!==i)n[a]++;else{if(++a===r)break;n[a]=1,i=!i}s++}if(a!==r&&(a!==r-1||s!==o))throw new T}static recordPatternInReverse(t,e,n){let r=n.length,o=t.get(e);for(;e>0&&r>=0;)t.get(--e)!==o&&(r--,o=!o);if(r>=0)throw new T;wt.recordPattern(t,e+1,n)}static patternMatchVariance(t,e,n){const r=t.length;let o=0,i=0;for(let n=0;n<r;n++)o+=t[n],i+=e[n];if(o<i)return Number.POSITIVE_INFINITY;const a=o/i;n*=a;let s=0;for(let o=0;o<r;o++){const r=t[o],i=e[o]*a,c=r>i?r-i:i-r;if(c>n)return Number.POSITIVE_INFINITY;s+=c}return s/o}}class $t extends wt{static findStartPattern(t){const e=t.getSize(),n=t.getNextSet(0);let r=0,o=Int32Array.from([0,0,0,0,0,0]),i=n,a=!1;const s=6;for(let c=n;c<e;c++)if(t.get(c)!==a)o[r]++;else{if(r===s-1){let e=$t.MAX_AVG_VARIANCE,n=-1;for(let t=$t.CODE_START_A;t<=$t.CODE_START_C;t++){const r=wt.patternMatchVariance(o,$t.CODE_PATTERNS[t],$t.MAX_INDIVIDUAL_VARIANCE);r<e&&(e=r,n=t)}if(n>=0&&t.isRange(Math.max(0,i-(c-i)/2),i,!1))return Int32Array.from([i,c,n]);i+=o[0]+o[1],o=o.slice(2,o.length-1),o[r-1]=0,o[r]=0,r--}else r++;o[r]=1,a=!a}throw new T}static decodeCode(t,e,n){wt.recordPattern(t,n,e);let r=$t.MAX_AVG_VARIANCE,o=-1;for(let t=0;t<$t.CODE_PATTERNS.length;t++){const n=$t.CODE_PATTERNS[t],i=this.patternMatchVariance(e,n,$t.MAX_INDIVIDUAL_VARIANCE);i<r&&(r=i,o=t)}if(o>=0)return o;throw new T}decodeRow(t,e,n){const r=n&&!0===n.get(b.ASSUME_GS1),o=$t.findStartPattern(e),i=o[2];let a=0;const s=new Uint8Array(20);let c;switch(s[a++]=i,i){case $t.CODE_START_A:c=$t.CODE_CODE_A;break;case $t.CODE_START_B:c=$t.CODE_CODE_B;break;case $t.CODE_START_C:c=$t.CODE_CODE_C;break;default:throw new v}let l=!1,d=!1,u="",m=o[0],f=o[1];const p=Int32Array.from([0,0,0,0,0,0]);let _=0,g=0,w=i,$=0,y=!0,I=!1,C=!1;for(;!l;){const t=d;switch(d=!1,_=g,g=$t.decodeCode(e,p,f),s[a++]=g,g!==$t.CODE_STOP&&(y=!0),g!==$t.CODE_STOP&&($++,w+=$*g),m=f,f+=p.reduce((t,e)=>t+e,0),g){case $t.CODE_START_A:case $t.CODE_START_B:case $t.CODE_START_C:throw new v}switch(c){case $t.CODE_CODE_A:if(g<64)u+=C===I?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else if(g<96)u+=C===I?String.fromCharCode(g-64):String.fromCharCode(g+64),C=!1;else switch(g!==$t.CODE_STOP&&(y=!1),g){case $t.CODE_FNC_1:r&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case $t.CODE_FNC_2:case $t.CODE_FNC_3:break;case $t.CODE_FNC_4_A:!I&&C?(I=!0,C=!1):I&&C?(I=!1,C=!1):C=!0;break;case $t.CODE_SHIFT:d=!0,c=$t.CODE_CODE_B;break;case $t.CODE_CODE_B:c=$t.CODE_CODE_B;break;case $t.CODE_CODE_C:c=$t.CODE_CODE_C;break;case $t.CODE_STOP:l=!0}break;case $t.CODE_CODE_B:if(g<96)u+=C===I?String.fromCharCode(" ".charCodeAt(0)+g):String.fromCharCode(" ".charCodeAt(0)+g+128),C=!1;else switch(g!==$t.CODE_STOP&&(y=!1),g){case $t.CODE_FNC_1:r&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case $t.CODE_FNC_2:case $t.CODE_FNC_3:break;case $t.CODE_FNC_4_B:!I&&C?(I=!0,C=!1):I&&C?(I=!1,C=!1):C=!0;break;case $t.CODE_SHIFT:d=!0,c=$t.CODE_CODE_A;break;case $t.CODE_CODE_A:c=$t.CODE_CODE_A;break;case $t.CODE_CODE_C:c=$t.CODE_CODE_C;break;case $t.CODE_STOP:l=!0}break;case $t.CODE_CODE_C:if(g<100)g<10&&(u+="0"),u+=g;else switch(g!==$t.CODE_STOP&&(y=!1),g){case $t.CODE_FNC_1:r&&(0===u.length?u+="]C1":u+=String.fromCharCode(29));break;case $t.CODE_CODE_A:c=$t.CODE_CODE_A;break;case $t.CODE_CODE_B:c=$t.CODE_CODE_B;break;case $t.CODE_STOP:l=!0}}t&&(c=c===$t.CODE_CODE_A?$t.CODE_CODE_B:$t.CODE_CODE_A)}const E=f-m;if(f=e.getNextUnset(f),!e.isRange(f,Math.min(e.getSize(),f+(f-m)/2),!1))throw new T;if(w-=$*_,w%103!==_)throw new h;const A=u.length;if(0===A)throw new T;A>0&&y&&(u=c===$t.CODE_CODE_C?u.substring(0,A-2):u.substring(0,A-1));const S=(o[1]+o[0])/2,k=m+E/2,R=s.length,N=new Uint8Array(R);for(let t=0;t<R;t++)N[t]=s[t];const D=[new at(S,t),new at(k,t)];return new L(u,N,0,D,V.CODE_128,(new Date).getTime())}}$t.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],$t.MAX_AVG_VARIANCE=.25,$t.MAX_INDIVIDUAL_VARIANCE=.7,$t.CODE_SHIFT=98,$t.CODE_CODE_C=99,$t.CODE_CODE_B=100,$t.CODE_CODE_A=101,$t.CODE_FNC_1=102,$t.CODE_FNC_2=97,$t.CODE_FNC_3=96,$t.CODE_FNC_4_A=101,$t.CODE_FNC_4_B=100,$t.CODE_START_A=103,$t.CODE_START_B=104,$t.CODE_START_C=105,$t.CODE_STOP=106;class yt extends wt{constructor(t=!1,e=!1){super(),this.usingCheckDigit=t,this.extendedMode=e,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(t,e,n){let r=this.counters;r.fill(0),this.decodeRowResult="";let o,i,a=yt.findAsteriskPattern(e,r),s=e.getNextSet(a[1]),c=e.getSize();do{yt.recordPattern(e,s,r);let t=yt.toNarrowWidePattern(r);if(t<0)throw new T;o=yt.patternToChar(t),this.decodeRowResult+=o,i=s;for(let t of r)s+=t;s=e.getNextSet(s)}while("*"!==o);this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let l,d=0;for(let t of r)d+=t;if(s!==c&&2*(s-i-d)<d)throw new T;if(this.usingCheckDigit){let t=this.decodeRowResult.length-1,e=0;for(let n=0;n<t;n++)e+=yt.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(n));if(this.decodeRowResult.charAt(t)!==yt.ALPHABET_STRING.charAt(e%43))throw new h;this.decodeRowResult=this.decodeRowResult.substring(0,t)}if(0===this.decodeRowResult.length)throw new T;l=this.extendedMode?yt.decodeExtended(this.decodeRowResult):this.decodeRowResult;let u=(a[1]+a[0])/2,m=i+d/2;return new L(l,null,0,[new at(u,t),new at(m,t)],V.CODE_39,(new Date).getTime())}static findAsteriskPattern(t,e){let n=t.getSize(),r=t.getNextSet(0),o=0,i=r,a=!1,s=e.length;for(let c=r;c<n;c++)if(t.get(c)!==a)e[o]++;else{if(o===s-1){if(this.toNarrowWidePattern(e)===yt.ASTERISK_ENCODING&&t.isRange(Math.max(0,i-Math.floor((c-i)/2)),i,!1))return[i,c];i+=e[0]+e[1],e.copyWithin(0,2,2+o-1),e[o-1]=0,e[o]=0,o--}else o++;e[o]=1,a=!a}throw new T}static toNarrowWidePattern(t){let e,n=t.length,r=0;do{let o=2147483647;for(let e of t)e<o&&e>r&&(o=e);r=o,e=0;let i=0,a=0;for(let o=0;o<n;o++){let s=t[o];s>r&&(a|=1<<n-1-o,e++,i+=s)}if(3===e){for(let o=0;o<n&&e>0;o++){let n=t[o];if(n>r&&(e--,2*n>=i))return-1}return a}}while(e>3);return-1}static patternToChar(t){for(let e=0;e<yt.CHARACTER_ENCODINGS.length;e++)if(yt.CHARACTER_ENCODINGS[e]===t)return yt.ALPHABET_STRING.charAt(e);if(t===yt.ASTERISK_ENCODING)return"*";throw new T}static decodeExtended(t){let e=t.length,n="";for(let r=0;r<e;r++){let e=t.charAt(r);if("+"===e||"$"===e||"%"===e||"/"===e){let o=t.charAt(r+1),i="\0";switch(e){case"+":if(!(o>="A"&&o<="Z"))throw new v;i=String.fromCharCode(o.charCodeAt(0)+32);break;case"$":if(!(o>="A"&&o<="Z"))throw new v;i=String.fromCharCode(o.charCodeAt(0)-64);break;case"%":if(o>="A"&&o<="E")i=String.fromCharCode(o.charCodeAt(0)-38);else if(o>="F"&&o<="J")i=String.fromCharCode(o.charCodeAt(0)-11);else if(o>="K"&&o<="O")i=String.fromCharCode(o.charCodeAt(0)+16);else if(o>="P"&&o<="T")i=String.fromCharCode(o.charCodeAt(0)+43);else if("U"===o)i="\0";else if("V"===o)i="@";else if("W"===o)i="`";else{if("X"!==o&&"Y"!==o&&"Z"!==o)throw new v;i=""}break;case"/":if(o>="A"&&o<="O")i=String.fromCharCode(o.charCodeAt(0)-32);else{if("Z"!==o)throw new v;i=":"}}n+=i,r++}else n+=e}return n}}yt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",yt.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],yt.ASTERISK_ENCODING=148;class bt extends wt{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(t,e,n){let r=this.decodeStart(e),o=this.decodeEnd(e),i=new S;bt.decodeMiddle(e,r[1],o[0],i);let a=i.toString(),s=null;null!=n&&(s=n.get(b.ALLOWED_LENGTHS)),null==s&&(s=bt.DEFAULT_ALLOWED_LENGTHS);let c=a.length,l=!1,d=0;for(let t of s){if(c===t){l=!0;break}t>d&&(d=t)}if(!l&&c>d&&(l=!0),!l)throw new v;const u=[new at(r[1],t),new at(o[0],t)];return new L(a,null,0,u,V.ITF,(new Date).getTime())}static decodeMiddle(t,e,n,r){let o=new Int32Array(10),i=new Int32Array(5),a=new Int32Array(5);for(o.fill(0),i.fill(0),a.fill(0);e<n;){wt.recordPattern(t,e,o);for(let t=0;t<5;t++){let e=2*t;i[t]=o[e],a[t]=o[e+1]}let n=bt.decodeDigit(i);r.append(n.toString()),n=this.decodeDigit(a),r.append(n.toString()),o.forEach(function(t){e+=t})}}decodeStart(t){let e=bt.skipWhiteSpace(t),n=bt.findGuardPattern(t,e,bt.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n}validateQuietZone(t,e){let n=10*this.narrowLineWidth;n=n<e?n:e;for(let r=e-1;n>0&&r>=0&&!t.get(r);r--)n--;if(0!==n)throw new T}static skipWhiteSpace(t){const e=t.getSize(),n=t.getNextSet(0);if(n===e)throw new T;return n}decodeEnd(t){t.reverse();try{let e,n=bt.skipWhiteSpace(t);try{e=bt.findGuardPattern(t,n,bt.END_PATTERN_REVERSED[0])}catch(r){r instanceof T&&(e=bt.findGuardPattern(t,n,bt.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,e[0]);let r=e[0];return e[0]=t.getSize()-e[1],e[1]=t.getSize()-r,e}finally{t.reverse()}}static findGuardPattern(t,e,n){let r=n.length,o=new Int32Array(r),i=t.getSize(),a=!1,s=0,c=e;o.fill(0);for(let l=e;l<i;l++)if(t.get(l)!==a)o[s]++;else{if(s===r-1){if(wt.patternMatchVariance(o,n,bt.MAX_INDIVIDUAL_VARIANCE)<bt.MAX_AVG_VARIANCE)return[c,l];c+=o[0]+o[1],f.arraycopy(o,2,o,0,s-1),o[s-1]=0,o[s]=0,s--}else s++;o[s]=1,a=!a}throw new T}static decodeDigit(t){let e=bt.MAX_AVG_VARIANCE,n=-1,r=bt.PATTERNS.length;for(let o=0;o<r;o++){let r=bt.PATTERNS[o],i=wt.patternMatchVariance(t,r,bt.MAX_INDIVIDUAL_VARIANCE);i<e?(e=i,n=o):i===e&&(n=-1)}if(n>=0)return n%10;throw new T}}bt.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],bt.MAX_AVG_VARIANCE=.38,bt.MAX_INDIVIDUAL_VARIANCE=.5,bt.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],bt.START_PATTERN=Int32Array.from([1,1,1,1]),bt.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class vt extends wt{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(t){let e,n=!1,r=0,o=Int32Array.from([0,0,0]);for(;!n;){o=Int32Array.from([0,0,0]),e=vt.findGuardPattern(t,r,!1,this.START_END_PATTERN,o);let i=e[0];r=e[1];let a=i-(r-i);a>=0&&(n=t.isRange(a,i,!1))}return e}static checkChecksum(t){return vt.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(0===e)return!1;let n=parseInt(t.charAt(e-1),10);return vt.getStandardUPCEANChecksum(t.substring(0,e-1))===n}static getStandardUPCEANChecksum(t){let e=t.length,n=0;for(let r=e-1;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}n*=3;for(let r=e-2;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}return(1e3-n)%10}static decodeEnd(t,e){return vt.findGuardPattern(t,e,!1,vt.START_END_PATTERN,new Int32Array(vt.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(t,e,n,r){return this.findGuardPattern(t,e,n,r,new Int32Array(r.length))}static findGuardPattern(t,e,n,r,o){let i=t.getSize(),a=0,s=e=n?t.getNextUnset(e):t.getNextSet(e),c=r.length,l=n;for(let n=e;n<i;n++)if(t.get(n)!==l)o[a]++;else{if(a===c-1){if(wt.patternMatchVariance(o,r,vt.MAX_INDIVIDUAL_VARIANCE)<vt.MAX_AVG_VARIANCE)return Int32Array.from([s,n]);s+=o[0]+o[1];let t=o.slice(2,o.length-1);for(let e=0;e<a-1;e++)o[e]=t[e];o[a-1]=0,o[a]=0,a--}else a++;o[a]=1,l=!l}throw new T}static decodeDigit(t,e,n,r){this.recordPattern(t,n,e);let o=this.MAX_AVG_VARIANCE,i=-1,a=r.length;for(let t=0;t<a;t++){let n=r[t],a=wt.patternMatchVariance(e,n,vt.MAX_INDIVIDUAL_VARIANCE);a<o&&(o=a,i=t)}if(i>=0)return i;throw new T}}vt.MAX_AVG_VARIANCE=.48,vt.MAX_INDIVIDUAL_VARIANCE=.7,vt.START_END_PATTERN=Int32Array.from([1,1,1]),vt.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),vt.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),vt.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class It{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,n){let r=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,r),i=r.toString(),a=It.parseExtensionString(i),s=[new at((n[0]+n[1])/2,t),new at(o,t)],c=new L(i,null,0,s,V.UPC_EAN_EXTENSION,(new Date).getTime());return null!=a&&c.putAllMetadata(a),c}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1],a=0;for(let e=0;e<5&&i<o;e++){let o=vt.decodeDigit(t,r,i,vt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<4-e),4!==e&&(i=t.getNextSet(i),i=t.getNextUnset(i))}if(5!==n.length)throw new T;let s=this.determineCheckDigit(a);if(It.extensionChecksum(n.toString())!==s)throw new T;return i}static extensionChecksum(t){let e=t.length,n=0;for(let r=e-2;r>=0;r-=2)n+=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);n*=3;for(let r=e-1;r>=0;r-=2)n+=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);return n*=3,n%10}determineCheckDigit(t){for(let e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new T}static parseExtensionString(t){if(5!==t.length)return null;let e=It.parseExtension5String(t);return null==e?null:new Map([[X.SUGGESTED_PRICE,e]])}static parseExtension5String(t){let e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e=""}let n=parseInt(t.substring(1)),r=n%100;return e+(n/100).toString()+"."+(r<10?"0"+r:r.toString())}}class Ct{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,n){let r=this.decodeRowStringBuffer,o=this.decodeMiddle(e,n,r),i=r.toString(),a=Ct.parseExtensionString(i),s=[new at((n[0]+n[1])/2,t),new at(o,t)],c=new L(i,null,0,s,V.UPC_EAN_EXTENSION,(new Date).getTime());return null!=a&&c.putAllMetadata(a),c}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1],a=0;for(let e=0;e<2&&i<o;e++){let o=vt.decodeDigit(t,r,i,vt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<1-e),1!==e&&(i=t.getNextSet(i),i=t.getNextUnset(i))}if(2!==n.length)throw new T;if(parseInt(n.toString())%4!==a)throw new T;return i}static parseExtensionString(t){return 2!==t.length?null:new Map([[X.ISSUE_NUMBER,parseInt(t)]])}}class Et{static decodeRow(t,e,n){let r=vt.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return(new It).decodeRow(t,e,r)}catch(n){return(new Ct).decodeRow(t,e,r)}}}Et.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class At extends vt{constructor(){super(),this.decodeRowStringBuffer="",At.L_AND_G_PATTERNS=At.L_PATTERNS.map(t=>Int32Array.from(t));for(let t=10;t<20;t++){let e=At.L_PATTERNS[t-10],n=new Int32Array(e.length);for(let t=0;t<e.length;t++)n[t]=e[e.length-t-1];At.L_AND_G_PATTERNS[t]=n}}decodeRow(t,e,n){let r=At.findStartGuardPattern(e),o=null==n?null:n.get(b.NEED_RESULT_POINT_CALLBACK);if(null!=o){const e=new at((r[0]+r[1])/2,t);o.foundPossibleResultPoint(e)}let i=this.decodeMiddle(e,r,this.decodeRowStringBuffer),a=i.rowOffset,s=i.resultString;if(null!=o){const e=new at(a,t);o.foundPossibleResultPoint(e)}let c=this.decodeEnd(e,a);if(null!=o){const e=new at((c[0]+c[1])/2,t);o.foundPossibleResultPoint(e)}let l=c[1],d=l+(l-c[0]);if(d>=e.getSize()||!e.isRange(l,d,!1))throw new T;let u=s.toString();if(u.length<8)throw new v;if(!At.checkChecksum(u))throw new h;let m=(r[1]+r[0])/2,f=(c[1]+c[0])/2,p=this.getBarcodeFormat(),_=[new at(m,t),new at(f,t)],g=new L(u,null,0,_,p,(new Date).getTime()),w=0;try{let n=Et.decodeRow(t,e,c[1]);g.putMetadata(X.UPC_EAN_EXTENSION,n.getText()),g.putAllMetadata(n.getResultMetadata()),g.addResultPoints(n.getResultPoints()),w=n.getText().length}catch(t){}let $=null==n?null:n.get(b.ALLOWED_EAN_EXTENSIONS);if(null!=$){let t=!1;for(let e in $)if(w.toString()===e){t=!0;break}if(!t)throw new T}return g}decodeEnd(t,e){return At.findGuardPattern(t,e,!1,At.START_END_PATTERN,new Int32Array(At.START_END_PATTERN.length).fill(0))}static checkChecksum(t){return At.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(0===e)return!1;let n=parseInt(t.charAt(e-1),10);return At.getStandardUPCEANChecksum(t.substring(0,e-1))===n}static getStandardUPCEANChecksum(t){let e=t.length,n=0;for(let r=e-1;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}n*=3;for(let r=e-2;r>=0;r-=2){let e=t.charAt(r).charCodeAt(0)-"0".charCodeAt(0);if(e<0||e>9)throw new v;n+=e}return(1e3-n)%10}}class St extends At{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1],a=0;for(let e=0;e<6&&i<o;e++){let o=At.decodeDigit(t,r,i,At.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<5-e)}n=St.determineFirstDigit(n,a),i=At.findGuardPattern(t,i,!0,At.MIDDLE_PATTERN,new Int32Array(At.MIDDLE_PATTERN.length).fill(0))[1];for(let e=0;e<6&&i<o;e++){let e=At.decodeDigit(t,r,i,At.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+e);for(let t of r)i+=t}return{rowOffset:i,resultString:n}}getBarcodeFormat(){return V.EAN_13}static determineFirstDigit(t,e){for(let n=0;n<10;n++)if(e===this.FIRST_DIGIT_ENCODINGS[n])return t=String.fromCharCode("0".charCodeAt(0)+n)+t;throw new T}}St.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class kt extends At{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,e,n){const r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o=t.getSize(),i=e[1];for(let e=0;e<4&&i<o;e++){let e=At.decodeDigit(t,r,i,At.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+e);for(let t of r)i+=t}i=At.findGuardPattern(t,i,!0,At.MIDDLE_PATTERN,new Int32Array(At.MIDDLE_PATTERN.length).fill(0))[1];for(let e=0;e<4&&i<o;e++){let e=At.decodeDigit(t,r,i,At.L_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+e);for(let t of r)i+=t}return{rowOffset:i,resultString:n}}getBarcodeFormat(){return V.EAN_8}}class Tt extends At{constructor(){super(...arguments),this.ean13Reader=new St}getBarcodeFormat(){return V.UPC_A}decode(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))}decodeRow(t,e,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,n))}decodeMiddle(t,e,n){return this.ean13Reader.decodeMiddle(t,e,n)}maybeReturnResult(t){let e=t.getText();if("0"===e.charAt(0)){let n=new L(e.substring(1),null,null,t.getResultPoints(),V.UPC_A);return null!=t.getResultMetadata()&&n.putAllMetadata(t.getResultMetadata()),n}throw new T}reset(){this.ean13Reader.reset()}}class Rt extends At{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(t,e,n){const r=this.decodeMiddleCounters.map(t=>t);r[0]=0,r[1]=0,r[2]=0,r[3]=0;const o=t.getSize();let i=e[1],a=0;for(let e=0;e<6&&i<o;e++){const o=Rt.decodeDigit(t,r,i,Rt.L_AND_G_PATTERNS);n+=String.fromCharCode("0".charCodeAt(0)+o%10);for(let t of r)i+=t;o>=10&&(a|=1<<5-e)}return{rowOffset:i,resultString:Rt.determineNumSysAndCheckDigit(n,a)}}decodeEnd(t,e){return Rt.findGuardPatternWithoutCounters(t,e,!0,Rt.MIDDLE_END_PATTERN)}checkChecksum(t){return At.checkChecksum(Rt.convertUPCEtoUPCA(t))}static determineNumSysAndCheckDigit(t,e){for(let n=0;n<=1;n++)for(let r=0;r<10;r++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r])return String.fromCharCode("0".charCodeAt(0)+n)+t+String.fromCharCode("0".charCodeAt(0)+r);throw T.getNotFoundInstance()}getBarcodeFormat(){return V.UPC_E}static convertUPCEtoUPCA(t){const e=t.slice(1,7).split("").map(t=>t.charCodeAt(0)),n=new S;n.append(t.charAt(0));let r=e[5];switch(r){case 0:case 1:case 2:n.appendChars(e,0,2),n.append(r),n.append("0000"),n.appendChars(e,2,3);break;case 3:n.appendChars(e,0,3),n.append("00000"),n.appendChars(e,3,2);break;case 4:n.appendChars(e,0,4),n.append("00000"),n.append(e[4]);break;default:n.appendChars(e,0,5),n.append("0000"),n.append(r)}return t.length>=8&&n.append(t.charAt(7)),n.toString()}}Rt.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Rt.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,26])];class Nt extends wt{constructor(t){super();let n=null==t?null:t.get(b.POSSIBLE_FORMATS),r=[];e(n)?(r.push(new St),r.push(new Tt),r.push(new kt),r.push(new Rt)):(n.indexOf(V.EAN_13)>-1&&r.push(new St),n.indexOf(V.UPC_A)>-1&&r.push(new Tt),n.indexOf(V.EAN_8)>-1&&r.push(new kt),n.indexOf(V.UPC_E)>-1&&r.push(new Rt)),this.readers=r}decodeRow(t,e,n){for(let r of this.readers)try{const o=r.decodeRow(t,e,n),i=o.getBarcodeFormat()===V.EAN_13&&"0"===o.getText().charAt(0),a=null==n?null:n.get(b.POSSIBLE_FORMATS),s=null==a||a.includes(V.UPC_A);if(i&&s){const t=o.getRawBytes(),e=new L(o.getText().substring(1),t,t?t.length:null,o.getResultPoints(),V.UPC_A);return e.putAllMetadata(o.getResultMetadata()),e}return o}catch(t){}throw new T}reset(){for(let t of this.readers)t.reset()}}class Dt extends wt{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(t,e){for(let n=0;n<e.length;n++)if(wt.patternMatchVariance(t,e[n],Dt.MAX_INDIVIDUAL_VARIANCE)<Dt.MAX_AVG_VARIANCE)return n;throw new T}static count(t){return ot.sum(new Int32Array(t))}static increment(t,e){let n=0,r=e[0];for(let o=1;o<t.length;o++)e[o]>r&&(r=e[o],n=o);t[n]++}static decrement(t,e){let n=0,r=e[0];for(let o=1;o<t.length;o++)e[o]<r&&(r=e[o],n=o);t[n]--}static isFinderPattern(t){let e=t[0]+t[1],n=e/(e+t[2]+t[3]);if(n>=Dt.MIN_FINDER_PATTERN_RATIO&&n<=Dt.MAX_FINDER_PATTERN_RATIO){let e=Number.MAX_SAFE_INTEGER,n=Number.MIN_SAFE_INTEGER;for(let r of t)r>n&&(n=r),r<e&&(e=r);return n<10*e}return!1}}Dt.MAX_AVG_VARIANCE=.2,Dt.MAX_INDIVIDUAL_VARIANCE=.45,Dt.MIN_FINDER_PATTERN_RATIO=9.5/12,Dt.MAX_FINDER_PATTERN_RATIO=12.5/14;class xt{constructor(t,e){this.value=t,this.checksumPortion=e}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(t){if(!(t instanceof xt))return!1;const e=t;return this.value===e.value&&this.checksumPortion===e.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class Ot{constructor(t,e,n,r,o){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new at(n,o)),this.resultPoints.push(new at(r,o))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(t){if(!(t instanceof Ot))return!1;const e=t;return this.value===e.value}hashCode(){return this.value}}class Mt{constructor(){}static getRSSvalue(t,e,n){let r=0;for(let e of t)r+=e;let o=0,i=0,a=t.length;for(let s=0;s<a-1;s++){let c;for(c=1,i|=1<<s;c<t[s];c++,i&=~(1<<s)){let t=Mt.combins(r-c-1,a-s-2);if(n&&0===i&&r-c-(a-s-1)>=a-s-1&&(t-=Mt.combins(r-c-(a-s),a-s-2)),a-s-1>1){let n=0;for(let t=r-c-(a-s-2);t>e;t--)n+=Mt.combins(r-c-t-1,a-s-3);t-=n*(a-1-s)}else r-c>e&&t--;o+=t}r-=c}return o}static combins(t,e){let n,r;t-e>e?(r=e,n=t-e):(r=t-e,n=e);let o=1,i=1;for(let e=t;e>n;e--)o*=e,i<=r&&(o/=i,i++);for(;i<=r;)o/=i,i++;return o}}class Pt{static buildBitArray(t){let e=2*t.length-1;null==t[t.length-1].getRightChar()&&(e-=1);let n=new $(12*e),r=0,o=t[0].getRightChar().getValue();for(let t=11;t>=0;--t)o&1<<t&&n.set(r),r++;for(let e=1;e<t.length;++e){let o=t[e],i=o.getLeftChar().getValue();for(let t=11;t>=0;--t)i&1<<t&&n.set(r),r++;if(null!=o.getRightChar()){let t=o.getRightChar().getValue();for(let e=11;e>=0;--e)t&1<<e&&n.set(r),r++}}return n}}class Bt{constructor(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class Ft{constructor(t){this.newPosition=t}getNewPosition(){return this.newPosition}}class Lt extends Ft{constructor(t,e){super(t),this.value=e}getValue(){return this.value}isFNC1(){return this.value===Lt.FNC1}}Lt.FNC1="$";class qt extends Ft{constructor(t,e,n){super(t),n?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=e}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class Vt extends Ft{constructor(t,e,n){if(super(t),e<0||e>10||n<0||n>10)throw new v;this.firstDigit=e,this.secondDigit=n}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return 10*this.firstDigit+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===Vt.FNC1}isSecondDigitFNC1(){return this.secondDigit===Vt.FNC1}isAnyFNC1(){return this.firstDigit===Vt.FNC1||this.secondDigit===Vt.FNC1}}Vt.FNC1=10;class Ht{constructor(){}static parseFieldsInGeneralPurpose(t){if(!t)return null;if(t.length<2)throw new T;let e=t.substring(0,2);for(let n of Ht.TWO_DIGIT_DATA_LENGTH)if(n[0]===e)return n[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(2,n[2],t):Ht.processFixedAI(2,n[1],t);if(t.length<3)throw new T;let n=t.substring(0,3);for(let e of Ht.THREE_DIGIT_DATA_LENGTH)if(e[0]===n)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(3,e[2],t):Ht.processFixedAI(3,e[1],t);for(let e of Ht.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(e[0]===n)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(4,e[2],t):Ht.processFixedAI(4,e[1],t);if(t.length<4)throw new T;let r=t.substring(0,4);for(let e of Ht.FOUR_DIGIT_DATA_LENGTH)if(e[0]===r)return e[1]===Ht.VARIABLE_LENGTH?Ht.processVariableAI(4,e[2],t):Ht.processFixedAI(4,e[1],t);throw new T}static processFixedAI(t,e,n){if(n.length<t)throw new T;let r=n.substring(0,t);if(n.length<t+e)throw new T;let o=n.substring(t,t+e),i=n.substring(t+e),a="("+r+")"+o,s=Ht.parseFieldsInGeneralPurpose(i);return null==s?a:a+s}static processVariableAI(t,e,n){let r,o=n.substring(0,t);r=n.length<t+e?n.length:t+e;let i=n.substring(t,r),a=n.substring(r),s="("+o+")"+i,c=Ht.parseFieldsInGeneralPurpose(a);return null==c?s:s+c}}Ht.VARIABLE_LENGTH=[],Ht.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",Ht.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",Ht.VARIABLE_LENGTH,20],["22",Ht.VARIABLE_LENGTH,29],["30",Ht.VARIABLE_LENGTH,8],["37",Ht.VARIABLE_LENGTH,8],["90",Ht.VARIABLE_LENGTH,30],["91",Ht.VARIABLE_LENGTH,30],["92",Ht.VARIABLE_LENGTH,30],["93",Ht.VARIABLE_LENGTH,30],["94",Ht.VARIABLE_LENGTH,30],["95",Ht.VARIABLE_LENGTH,30],["96",Ht.VARIABLE_LENGTH,30],["97",Ht.VARIABLE_LENGTH,3],["98",Ht.VARIABLE_LENGTH,30],["99",Ht.VARIABLE_LENGTH,30]],Ht.THREE_DIGIT_DATA_LENGTH=[["240",Ht.VARIABLE_LENGTH,30],["241",Ht.VARIABLE_LENGTH,30],["242",Ht.VARIABLE_LENGTH,6],["250",Ht.VARIABLE_LENGTH,30],["251",Ht.VARIABLE_LENGTH,30],["253",Ht.VARIABLE_LENGTH,17],["254",Ht.VARIABLE_LENGTH,20],["400",Ht.VARIABLE_LENGTH,30],["401",Ht.VARIABLE_LENGTH,30],["402",17],["403",Ht.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",Ht.VARIABLE_LENGTH,20],["421",Ht.VARIABLE_LENGTH,15],["422",3],["423",Ht.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],Ht.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",Ht.VARIABLE_LENGTH,15],["391",Ht.VARIABLE_LENGTH,18],["392",Ht.VARIABLE_LENGTH,15],["393",Ht.VARIABLE_LENGTH,18],["703",Ht.VARIABLE_LENGTH,30]],Ht.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",Ht.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",Ht.VARIABLE_LENGTH,20],["8003",Ht.VARIABLE_LENGTH,30],["8004",Ht.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",Ht.VARIABLE_LENGTH,30],["8008",Ht.VARIABLE_LENGTH,12],["8018",18],["8020",Ht.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",Ht.VARIABLE_LENGTH,70],["8200",Ht.VARIABLE_LENGTH,70]];class Ut{constructor(t){this.buffer=new S,this.information=t}decodeAllCodes(t,e){let n=e,r=null;for(;;){let e=this.decodeGeneralPurposeField(n,r),o=Ht.parseFieldsInGeneralPurpose(e.getNewString());if(null!=o&&t.append(o),r=e.isRemaining()?""+e.getRemainingValue():null,n===e.getNewPosition())break;n=e.getNewPosition()}return t.toString()}isStillNumeric(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(let e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)}decodeNumeric(t){if(t+7>this.information.getSize()){let e=this.extractNumericValueFromBitArray(t,4);return new Vt(this.information.getSize(),0===e?Vt.FNC1:e-1,Vt.FNC1)}let e=this.extractNumericValueFromBitArray(t,7);return new Vt(t+7,(e-8)/11,(e-8)%11)}extractNumericValueFromBitArray(t,e){return Ut.extractNumericValueFromBitArray(this.information,t,e)}static extractNumericValueFromBitArray(t,e,n){let r=0;for(let o=0;o<n;++o)t.get(e+o)&&(r|=1<<n-o-1);return r}decodeGeneralPurposeField(t,e){this.buffer.setLengthToZero(),null!=e&&this.buffer.append(e),this.current.setPosition(t);let n=this.parseBlocks();return null!=n&&n.isRemaining()?new qt(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new qt(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let t,e;do{let n=this.current.getPosition();if(this.current.isAlpha()?(e=this.parseAlphaBlock(),t=e.isFinished()):this.current.isIsoIec646()?(e=this.parseIsoIec646Block(),t=e.isFinished()):(e=this.parseNumericBlock(),t=e.isFinished()),n===this.current.getPosition()&&!t)break}while(!t);return e.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){let e;return e=t.isSecondDigitFNC1()?new qt(this.current.getPosition(),this.buffer.toString()):new qt(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new Bt(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){let t=new qt(this.current.getPosition(),this.buffer.toString());return new Bt(!0,t)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Bt(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let t=new qt(this.current.getPosition(),this.buffer.toString());return new Bt(!0,t)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Bt(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let t=new qt(this.current.getPosition(),this.buffer.toString());return new Bt(!0,t)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Bt(!1)}isStillIsoIec646(t){if(t+5>this.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+7>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(t,8);return r>=232&&r<253}decodeIsoIec646(t){let e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Lt(t+5,Lt.FNC1);if(e>=5&&e<15)return new Lt(t+5,"0"+(e-5));let n,r=this.extractNumericValueFromBitArray(t,7);if(r>=64&&r<90)return new Lt(t+7,""+(r+1));if(r>=90&&r<116)return new Lt(t+7,""+(r+7));switch(this.extractNumericValueFromBitArray(t,8)){case 232:n="!";break;case 233:n='"';break;case 234:n="%";break;case 235:n="&";break;case 236:n="'";break;case 237:n="(";break;case 238:n=")";break;case 239:n="*";break;case 240:n="+";break;case 241:n=",";break;case 242:n="-";break;case 243:n=".";break;case 244:n="/";break;case 245:n=":";break;case 246:n=";";break;case 247:n="<";break;case 248:n="=";break;case 249:n=">";break;case 250:n="?";break;case 251:n="_";break;case 252:n=" ";break;default:throw new v}return new Lt(t+8,n)}isStillAlpha(t){if(t+5>this.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63}decodeAlphanumeric(t){let e=this.extractNumericValueFromBitArray(t,5);if(15===e)return new Lt(t+5,Lt.FNC1);if(e>=5&&e<15)return new Lt(t+5,"0"+(e-5));let n,r=this.extractNumericValueFromBitArray(t,6);if(r>=32&&r<58)return new Lt(t+6,""+(r+33));switch(r){case 58:n="*";break;case 59:n=",";break;case 60:n="-";break;case 61:n=".";break;case 62:n="/";break;default:throw new et("Decoding invalid alphanumeric value: "+r)}return new Lt(t+6,n)}isAlphaTo646ToAlphaLatch(t){if(t+1>this.information.getSize())return!1;for(let e=0;e<5&&e+t<this.information.getSize();++e)if(2===e){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0}isAlphaOr646ToNumericLatch(t){if(t+3>this.information.getSize())return!1;for(let e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0}isNumericToAlphaNumericLatch(t){if(t+1>this.information.getSize())return!1;for(let e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0}}class zt{constructor(t){this.information=t,this.generalDecoder=new Ut(t)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class Wt extends zt{constructor(t){super(t)}encodeCompressedGtin(t,e){t.append("(01)");let n=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,e,n)}encodeCompressedGtinWithoutAI(t,e,n){for(let n=0;n<4;++n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(e+10*n,10);r/100==0&&t.append("0"),r/10==0&&t.append("0"),t.append(r)}Wt.appendCheckDigit(t,n)}static appendCheckDigit(t,e){let n=0;for(let r=0;r<13;r++){let o=t.charAt(r+e).charCodeAt(0)-"0".charCodeAt(0);n+=1&r?o:3*o}n=10-n%10,10===n&&(n=0),t.append(n)}}Wt.GTIN_SIZE=40;class jt extends Wt{constructor(t){super(t)}parseInformation(){let t=new S;t.append("(01)");let e=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(jt.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,jt.HEADER_SIZE+4,e),this.getGeneralDecoder().decodeAllCodes(t,jt.HEADER_SIZE+44)}}jt.HEADER_SIZE=4;class Gt extends zt{constructor(t){super(t)}parseInformation(){let t=new S;return this.getGeneralDecoder().decodeAllCodes(t,Gt.HEADER_SIZE)}}Gt.HEADER_SIZE=5;class Xt extends Wt{constructor(t){super(t)}encodeCompressedWeight(t,e,n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(e,n);this.addWeightCode(t,r);let o=this.checkWeight(r),i=1e5;for(let e=0;e<5;++e)o/i===0&&t.append("0"),i/=10;t.append(o)}}class Qt extends Xt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()!=Qt.HEADER_SIZE+Xt.GTIN_SIZE+Qt.WEIGHT_SIZE)throw new T;let t=new S;return this.encodeCompressedGtin(t,Qt.HEADER_SIZE),this.encodeCompressedWeight(t,Qt.HEADER_SIZE+Xt.GTIN_SIZE,Qt.WEIGHT_SIZE),t.toString()}}Qt.HEADER_SIZE=5,Qt.WEIGHT_SIZE=15;class Yt extends Qt{constructor(t){super(t)}addWeightCode(t,e){t.append("(3103)")}checkWeight(t){return t}}class Zt extends Qt{constructor(t){super(t)}addWeightCode(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")}checkWeight(t){return t<1e4?t:t-1e4}}class Kt extends Wt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Kt.HEADER_SIZE+Wt.GTIN_SIZE)throw new T;let t=new S;this.encodeCompressedGtin(t,Kt.HEADER_SIZE);let e=this.getGeneralDecoder().extractNumericValueFromBitArray(Kt.HEADER_SIZE+Wt.GTIN_SIZE,Kt.LAST_DIGIT_SIZE);t.append("(392"),t.append(e),t.append(")");let n=this.getGeneralDecoder().decodeGeneralPurposeField(Kt.HEADER_SIZE+Wt.GTIN_SIZE+Kt.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()}}Kt.HEADER_SIZE=8,Kt.LAST_DIGIT_SIZE=2;class Jt extends Wt{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Jt.HEADER_SIZE+Wt.GTIN_SIZE)throw new T;let t=new S;this.encodeCompressedGtin(t,Jt.HEADER_SIZE);let e=this.getGeneralDecoder().extractNumericValueFromBitArray(Jt.HEADER_SIZE+Wt.GTIN_SIZE,Jt.LAST_DIGIT_SIZE);t.append("(393"),t.append(e),t.append(")");let n=this.getGeneralDecoder().extractNumericValueFromBitArray(Jt.HEADER_SIZE+Wt.GTIN_SIZE+Jt.LAST_DIGIT_SIZE,Jt.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);let r=this.getGeneralDecoder().decodeGeneralPurposeField(Jt.HEADER_SIZE+Wt.GTIN_SIZE+Jt.LAST_DIGIT_SIZE+Jt.FIRST_THREE_DIGITS_SIZE,null);return t.append(r.getNewString()),t.toString()}}Jt.HEADER_SIZE=8,Jt.LAST_DIGIT_SIZE=2,Jt.FIRST_THREE_DIGITS_SIZE=10;class te extends Xt{constructor(t,e,n){super(t),this.dateCode=n,this.firstAIdigits=e}parseInformation(){if(this.getInformation().getSize()!=te.HEADER_SIZE+te.GTIN_SIZE+te.WEIGHT_SIZE+te.DATE_SIZE)throw new T;let t=new S;return this.encodeCompressedGtin(t,te.HEADER_SIZE),this.encodeCompressedWeight(t,te.HEADER_SIZE+te.GTIN_SIZE,te.WEIGHT_SIZE),this.encodeCompressedDate(t,te.HEADER_SIZE+te.GTIN_SIZE+te.WEIGHT_SIZE),t.toString()}encodeCompressedDate(t,e){let n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,te.DATE_SIZE);if(38400==n)return;t.append("("),t.append(this.dateCode),t.append(")");let r=n%32;n/=32;let o=n%12+1;n/=12;let i=n;i/10==0&&t.append("0"),t.append(i),o/10==0&&t.append("0"),t.append(o),r/10==0&&t.append("0"),t.append(r)}addWeightCode(t,e){t.append("("),t.append(this.firstAIdigits),t.append(e/1e5),t.append(")")}checkWeight(t){return t%1e5}}function ee(t){try{if(t.get(1))return new jt(t);if(!t.get(2))return new Gt(t);switch(Ut.extractNumericValueFromBitArray(t,1,4)){case 4:return new Yt(t);case 5:return new Zt(t)}switch(Ut.extractNumericValueFromBitArray(t,1,5)){case 12:return new Kt(t);case 13:return new Jt(t)}switch(Ut.extractNumericValueFromBitArray(t,1,7)){case 56:return new te(t,"310","11");case 57:return new te(t,"320","11");case 58:return new te(t,"310","13");case 59:return new te(t,"320","13");case 60:return new te(t,"310","15");case 61:return new te(t,"320","15");case 62:return new te(t,"310","17");case 63:return new te(t,"320","17")}}catch(e){throw console.log(e),new et("unknown decoder: "+t)}}te.HEADER_SIZE=8,te.WEIGHT_SIZE=20,te.DATE_SIZE=16;class ne{constructor(t,e,n,r){this.leftchar=t,this.rightchar=e,this.finderpattern=n,this.maybeLast=r}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return null==this.rightchar}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(null==this.finderpattern?"null":this.finderpattern.getValue())+" ]"}static equals(t,e){return t instanceof ne&&ne.equalsOrNull(t.leftchar,e.leftchar)&&ne.equalsOrNull(t.rightchar,e.rightchar)&&ne.equalsOrNull(t.finderpattern,e.finderpattern)}static equalsOrNull(t,e){return null===t?null===e:ne.equals(t,e)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class re{constructor(t,e,n){this.pairs=t,this.rowNumber=e,this.wasReversed=n}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(t){return this.checkEqualitity(this,t)}toString(){return"{ "+this.pairs+" }"}equals(t,e){return t instanceof re&&this.checkEqualitity(t,e)&&t.wasReversed===e.wasReversed}checkEqualitity(t,e){if(!t||!e)return;let n;return t.forEach((t,r)=>{e.forEach(e=>{t.getLeftChar().getValue()===e.getLeftChar().getValue()&&t.getRightChar().getValue()===e.getRightChar().getValue()&&t.getFinderPatter().getValue()===e.getFinderPatter().getValue()&&(n=!0)})}),n}}class oe extends Dt{constructor(t){super(...arguments),this.pairs=new Array(oe.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=!0===t}decodeRow(t,e,n){this.pairs.length=0,this.startFromEven=!1;try{return oe.constructResult(this.decodeRow2pairs(t,e))}catch(t){this.verbose&&console.log(t)}return this.pairs.length=0,this.startFromEven=!0,oe.constructResult(this.decodeRow2pairs(t,e))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(t,e){let n,r=!1;for(;!r;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(t){if(t instanceof T){if(!this.pairs.length)throw new T;r=!0}}if(this.checkChecksum())return this.pairs;if(n=!!this.rows.length,this.storeRow(t,!1),n){let t=this.checkRowsBoolean(!1);if(null!=t)return t;if(t=this.checkRowsBoolean(!0),null!=t)return t}throw new T}checkRowsBoolean(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());let e=null;try{e=this.checkRows(new Array,0)}catch(t){this.verbose&&console.log(t)}return t&&(this.rows=this.rows.reverse()),e}checkRows(t,e){for(let n=e;n<this.rows.length;n++){let e=this.rows[n];this.pairs.length=0;for(let e of t)this.pairs.push(e.getPairs());if(this.pairs.push(e.getPairs()),!oe.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let r=new Array(t);r.push(e);try{return this.checkRows(r,n+1)}catch(t){this.verbose&&console.log(t)}}throw new T}static isValidSequence(t){for(let e of oe.FINDER_PATTERN_SEQUENCES){if(t.length>e.length)continue;let n=!0;for(let r=0;r<t.length;r++)if(t[r].getFinderPattern().getValue()!=e[r]){n=!1;break}if(n)return!0}return!1}storeRow(t,e){let n=0,r=!1,o=!1;for(;n<this.rows.length;){let e=this.rows[n];if(e.getRowNumber()>t){o=e.isEquivalent(this.pairs);break}r=e.isEquivalent(this.pairs),n++}o||r||oe.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new re(this.pairs,t,e)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(t,e){for(let n of e)if(n.getPairs().length!==t.length)for(let e of n.getPairs())for(let n of t)if(ne.equals(e,n))break}static isPartialRow(t,e){for(let n of e){let e=!0;for(let r of t){let t=!1;for(let e of n.getPairs())if(r.equals(e)){t=!0;break}if(!t){e=!1;break}}if(e)return!0}return!1}getRows(){return this.rows}static constructResult(t){let e=ee(Pt.buildBitArray(t)).parseInformation(),n=t[0].getFinderPattern().getResultPoints(),r=t[t.length-1].getFinderPattern().getResultPoints(),o=[n[0],n[1],r[0],r[1]];return new L(e,null,null,o,V.RSS_EXPANDED,null)}checkChecksum(){let t=this.pairs.get(0),e=t.getLeftChar(),n=t.getRightChar();if(null==n)return!1;let r=n.getChecksumPortion(),o=2;for(let t=1;t<this.pairs.size();++t){let e=this.pairs.get(t);r+=e.getLeftChar().getChecksumPortion(),o++;let n=e.getRightChar();null!=n&&(r+=n.getChecksumPortion(),o++)}return r%=211,211*(o-4)+r==e.getValue()}static getNextSecondBar(t,e){let n;return t.get(e)?(n=t.getNextUnset(e),n=t.getNextSet(n)):(n=t.getNextSet(e),n=t.getNextUnset(n)),n}retrieveNextPair(t,e,n){let r,o=e.length%2==0;this.startFromEven&&(o=!o);let i=!0,a=-1;do{this.findNextPair(t,e,a),r=this.parseFoundFinderPattern(t,n,o),null==r?a=oe.getNextSecondBar(t,this.startEnd[0]):i=!1}while(i);let s,c=this.decodeDataCharacter(t,r,o,!0);if(!this.isEmptyPair(e)&&e[e.length-1].mustBeLast())throw new T;try{s=this.decodeDataCharacter(t,r,o,!1)}catch(t){s=null,this.verbose&&console.log(t)}return new ne(c,s,r,!0)}isEmptyPair(t){return 0===t.length}findNextPair(t,e,n){let r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;let o,i=t.getSize();o=n>=0?n:this.isEmptyPair(e)?0:e[e.length-1].getFinderPattern().getStartEnd()[1];let a=e.length%2!=0;this.startFromEven&&(a=!a);let s=!1;for(;o<i&&(s=!t.get(o),s);)o++;let c=0,l=o;for(let e=o;e<i;e++)if(t.get(e)!=s)r[c]++;else{if(3==c){if(a&&oe.reverseCounters(r),oe.isFinderPattern(r))return this.startEnd[0]=l,void(this.startEnd[1]=e);a&&oe.reverseCounters(r),l+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,c--}else c++;r[c]=1,s=!s}throw new T}static reverseCounters(t){let e=t.length;for(let n=0;n<e/2;++n){let r=t[n];t[n]=t[e-n-1],t[e-n-1]=r}}parseFoundFinderPattern(t,e,n){let r,o,i;if(n){let e=this.startEnd[0]-1;for(;e>=0&&!t.get(e);)e--;e++,r=this.startEnd[0]-e,o=e,i=this.startEnd[1]}else o=this.startEnd[0],i=t.getNextUnset(this.startEnd[1]+1),r=i-this.startEnd[1];let a,s=this.getDecodeFinderCounters();f.arraycopy(s,0,s,1,s.length-1),s[0]=r;try{a=this.parseFinderValue(s,oe.FINDER_PATTERNS)}catch(t){return null}return new Ot(a,[o,i],o,i,e)}decodeDataCharacter(t,e,n,r){let o=this.getDataCharacterCounters();for(let t=0;t<o.length;t++)o[t]=0;if(r)oe.recordPatternInReverse(t,e.getStartEnd()[0],o);else{oe.recordPattern(t,e.getStartEnd()[1],o);for(let t=0,e=o.length-1;t<e;t++,e--){let n=o[t];o[t]=o[e],o[e]=n}}let i=17,a=ot.sum(new Int32Array(o))/i,s=(e.getStartEnd()[1]-e.getStartEnd()[0])/15;if(Math.abs(a-s)/s>.3)throw new T;let c=this.getOddCounts(),l=this.getEvenCounts(),d=this.getOddRoundingErrors(),u=this.getEvenRoundingErrors();for(let t=0;t<o.length;t++){let e=1*o[t]/a,n=e+.5;if(n<1){if(e<.3)throw new T;n=1}else if(n>8){if(e>8.7)throw new T;n=8}let r=t/2;1&t?(l[r]=n,u[r]=e-n):(c[r]=n,d[r]=e-n)}this.adjustOddEvenCounts(i);let h=4*e.getValue()+(n?0:2)+(r?0:1)-1,m=0,f=0;for(let t=c.length-1;t>=0;t--){if(oe.isNotA1left(e,n,r)){let e=oe.WEIGHTS[h][2*t];f+=c[t]*e}m+=c[t]}let p=0;for(let t=l.length-1;t>=0;t--)if(oe.isNotA1left(e,n,r)){let e=oe.WEIGHTS[h][2*t+1];p+=l[t]*e}let _=f+p;if(1&m||m>13||m<4)throw new T;let g=(13-m)/2,w=oe.SYMBOL_WIDEST[g],$=9-w,y=Mt.getRSSvalue(c,w,!0),b=Mt.getRSSvalue(l,$,!1),v=oe.EVEN_TOTAL_SUBSET[g],I=oe.GSUM[g];return new xt(y*v+b+I,_)}static isNotA1left(t,e,n){return!(0==t.getValue()&&e&&n)}adjustOddEvenCounts(t){let e=ot.sum(new Int32Array(this.getOddCounts())),n=ot.sum(new Int32Array(this.getEvenCounts())),r=!1,o=!1;e>13?o=!0:e<4&&(r=!0);let i=!1,a=!1;n>13?a=!0:n<4&&(i=!0);let s=e+n-t,c=!(1&~e),l=!(1&n);if(1==s)if(c){if(l)throw new T;o=!0}else{if(!l)throw new T;a=!0}else if(-1==s)if(c){if(l)throw new T;r=!0}else{if(!l)throw new T;i=!0}else{if(0!=s)throw new T;if(c){if(!l)throw new T;e<n?(r=!0,a=!0):(o=!0,i=!0)}else if(l)throw new T}if(r){if(o)throw new T;oe.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(o&&oe.decrement(this.getOddCounts(),this.getOddRoundingErrors()),i){if(a)throw new T;oe.increment(this.getEvenCounts(),this.getOddRoundingErrors())}a&&oe.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}oe.SYMBOL_WIDEST=[7,5,4,3,1],oe.EVEN_TOTAL_SUBSET=[4,20,52,104,204],oe.GSUM=[0,348,1388,2948,3988],oe.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],oe.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,91],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],oe.FINDER_PAT_A=0,oe.FINDER_PAT_B=1,oe.FINDER_PAT_C=2,oe.FINDER_PAT_D=3,oe.FINDER_PAT_E=4,oe.FINDER_PAT_F=5,oe.FINDER_PATTERN_SEQUENCES=[[oe.FINDER_PAT_A,oe.FINDER_PAT_A],[oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B],[oe.FINDER_PAT_A,oe.FINDER_PAT_C,oe.FINDER_PAT_B,oe.FINDER_PAT_D],[oe.FINDER_PAT_A,oe.FINDER_PAT_E,oe.FINDER_PAT_B,oe.FINDER_PAT_D,oe.FINDER_PAT_C],[oe.FINDER_PAT_A,oe.FINDER_PAT_E,oe.FINDER_PAT_B,oe.FINDER_PAT_D,oe.FINDER_PAT_D,oe.FINDER_PAT_F],[oe.FINDER_PAT_A,oe.FINDER_PAT_E,oe.FINDER_PAT_B,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_F,oe.FINDER_PAT_F],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_D],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_E],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_F,oe.FINDER_PAT_F],[oe.FINDER_PAT_A,oe.FINDER_PAT_A,oe.FINDER_PAT_B,oe.FINDER_PAT_B,oe.FINDER_PAT_C,oe.FINDER_PAT_D,oe.FINDER_PAT_D,oe.FINDER_PAT_E,oe.FINDER_PAT_E,oe.FINDER_PAT_F,oe.FINDER_PAT_F]],oe.MAX_PAIRS=11;class ie extends xt{constructor(t,e,n){super(t,e),this.count=0,this.finderPattern=n}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class ae extends Dt{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(t,e,n){const r=this.decodePair(e,!1,t,n);ae.addOrTally(this.possibleLeftPairs,r),e.reverse();let o=this.decodePair(e,!0,t,n);ae.addOrTally(this.possibleRightPairs,o),e.reverse();for(let t of this.possibleLeftPairs)if(t.getCount()>1)for(let e of this.possibleRightPairs)if(e.getCount()>1&&ae.checkChecksum(t,e))return ae.constructResult(t,e);throw new T}static addOrTally(t,e){if(null==e)return;let n=!1;for(let r of t)if(r.getValue()===e.getValue()){r.incrementCount(),n=!0;break}n||t.push(e)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(t,e){let n=4537077*t.getValue()+e.getValue(),r=new String(n).toString(),o=new S;for(let t=13-r.length;t>0;t--)o.append("0");o.append(r);let i=0;for(let t=0;t<13;t++){let e=o.charAt(t).charCodeAt(0)-"0".charCodeAt(0);i+=1&t?e:3*e}i=10-i%10,10===i&&(i=0),o.append(i.toString());let a=t.getFinderPattern().getResultPoints(),s=e.getFinderPattern().getResultPoints();return new L(o.toString(),null,0,[a[0],a[1],s[0],s[1]],V.RSS_14,(new Date).getTime())}static checkChecksum(t,e){let n=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,r=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r}decodePair(t,e,n,r){try{let o=this.findFinderPattern(t,e),i=this.parseFoundFinderPattern(t,n,e,o),a=null==r?null:r.get(b.NEED_RESULT_POINT_CALLBACK);if(null!=a){let r=(o[0]+o[1])/2;e&&(r=t.getSize()-1-r),a.foundPossibleResultPoint(new at(r,n))}let s=this.decodeDataCharacter(t,i,!0),c=this.decodeDataCharacter(t,i,!1);return new ie(1597*s.getValue()+c.getValue(),s.getChecksumPortion()+4*c.getChecksumPortion(),i)}catch(t){return null}}decodeDataCharacter(t,e,n){let r=this.getDataCharacterCounters();for(let t=0;t<r.length;t++)r[t]=0;if(n)wt.recordPatternInReverse(t,e.getStartEnd()[0],r);else{wt.recordPattern(t,e.getStartEnd()[1]+1,r);for(let t=0,e=r.length-1;t<e;t++,e--){let n=r[t];r[t]=r[e],r[e]=n}}let o=n?16:15,i=ot.sum(new Int32Array(r))/o,a=this.getOddCounts(),s=this.getEvenCounts(),c=this.getOddRoundingErrors(),l=this.getEvenRoundingErrors();for(let t=0;t<r.length;t++){let e=r[t]/i,n=Math.floor(e+.5);n<1?n=1:n>8&&(n=8);let o=Math.floor(t/2);1&t?(s[o]=n,l[o]=e-n):(a[o]=n,c[o]=e-n)}this.adjustOddEvenCounts(n,o);let d=0,u=0;for(let t=a.length-1;t>=0;t--)u*=9,u+=a[t],d+=a[t];let h=0,m=0;for(let t=s.length-1;t>=0;t--)h*=9,h+=s[t],m+=s[t];let f=u+3*h;if(n){if(1&d||d>12||d<4)throw new T;let t=(12-d)/2,e=ae.OUTSIDE_ODD_WIDEST[t],n=9-e,r=Mt.getRSSvalue(a,e,!1),o=Mt.getRSSvalue(s,n,!0),i=ae.OUTSIDE_EVEN_TOTAL_SUBSET[t],c=ae.OUTSIDE_GSUM[t];return new xt(r*i+o+c,f)}{if(1&m||m>10||m<4)throw new T;let t=(10-m)/2,e=ae.INSIDE_ODD_WIDEST[t],n=9-e,r=Mt.getRSSvalue(a,e,!0),o=Mt.getRSSvalue(s,n,!1),i=ae.INSIDE_ODD_TOTAL_SUBSET[t],c=ae.INSIDE_GSUM[t];return new xt(o*i+r+c,f)}}findFinderPattern(t,e){let n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;let r=t.getSize(),o=!1,i=0;for(;i<r&&(o=!t.get(i),e!==o);)i++;let a=0,s=i;for(let e=i;e<r;e++)if(t.get(e)!==o)n[a]++;else{if(3===a){if(Dt.isFinderPattern(n))return[s,e];s+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,a--}else a++;n[a]=1,o=!o}throw new T}parseFoundFinderPattern(t,e,n,r){let o=t.get(r[0]),i=r[0]-1;for(;i>=0&&o!==t.get(i);)i--;i++;const a=r[0]-i,s=this.getDecodeFinderCounters(),c=new Int32Array(s.length);f.arraycopy(s,0,c,1,s.length-1),c[0]=a;const l=this.parseFinderValue(c,ae.FINDER_PATTERNS);let d=i,u=r[1];return n&&(d=t.getSize()-1-d,u=t.getSize()-1-u),new Ot(l,[i,r[1]],d,u,e)}adjustOddEvenCounts(t,e){let n=ot.sum(new Int32Array(this.getOddCounts())),r=ot.sum(new Int32Array(this.getEvenCounts())),o=!1,i=!1,a=!1,s=!1;t?(n>12?i=!0:n<4&&(o=!0),r>12?s=!0:r<4&&(a=!0)):(n>11?i=!0:n<5&&(o=!0),r>10?s=!0:r<4&&(a=!0));let c=n+r-e,l=(1&n)==(t?1:0),d=!(1&~r);if(1===c)if(l){if(d)throw new T;i=!0}else{if(!d)throw new T;s=!0}else if(-1===c)if(l){if(d)throw new T;o=!0}else{if(!d)throw new T;a=!0}else{if(0!==c)throw new T;if(l){if(!d)throw new T;n<r?(o=!0,s=!0):(i=!0,a=!0)}else if(d)throw new T}if(o){if(i)throw new T;Dt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&Dt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),a){if(s)throw new T;Dt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}s&&Dt.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}ae.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],ae.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],ae.OUTSIDE_GSUM=[0,161,961,2015,2715],ae.INSIDE_GSUM=[0,336,1036,1516],ae.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],ae.INSIDE_ODD_WIDEST=[2,4,6,8],ae.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class se extends wt{constructor(t,e){super(),this.readers=[],this.verbose=!0===e;const n=t?t.get(b.POSSIBLE_FORMATS):null,r=t&&void 0!==t.get(b.ASSUME_CODE_39_CHECK_DIGIT);n?((n.includes(V.EAN_13)||n.includes(V.UPC_A)||n.includes(V.EAN_8)||n.includes(V.UPC_E))&&this.readers.push(new Nt(t)),n.includes(V.CODE_39)&&this.readers.push(new yt(r)),n.includes(V.CODE_128)&&this.readers.push(new $t),n.includes(V.ITF)&&this.readers.push(new bt),n.includes(V.RSS_14)&&this.readers.push(new ae),n.includes(V.RSS_EXPANDED)&&this.readers.push(new oe(this.verbose))):(this.readers.push(new Nt(t)),this.readers.push(new yt),this.readers.push(new Nt(t)),this.readers.push(new $t),this.readers.push(new bt),this.readers.push(new ae),this.readers.push(new oe(this.verbose)))}decodeRow(t,e,n){for(let r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(t,e,n)}catch(t){}throw new T}reset(){this.readers.forEach(t=>t.reset())}}class ce extends F{constructor(t=500,e){super(new se(e),t,e)}}class le{constructor(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class de{constructor(t,e){this.count=t,this.dataCodewords=e}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class ue{constructor(t,e,n,r,o,i){this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=o,this.ecBlocks=i;let a=0;const s=i.getECCodewords(),c=i.getECBlocks();for(let t of c)a+=t.getCount()*(t.getDataCodewords()+s);this.totalCodewords=a}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(t,e){if(1&t||1&e)throw new v;for(let n of ue.VERSIONS)if(n.symbolSizeRows===t&&n.symbolSizeColumns===e)return n;throw new v}toString(){return""+this.versionNumber}static buildVersions(){return[new ue(1,10,10,8,8,new le(5,new de(1,3))),new ue(2,12,12,10,10,new le(7,new de(1,5))),new ue(3,14,14,12,12,new le(10,new de(1,8))),new ue(4,16,16,14,14,new le(12,new de(1,12))),new ue(5,18,18,16,16,new le(14,new de(1,18))),new ue(6,20,20,18,18,new le(18,new de(1,22))),new ue(7,22,22,20,20,new le(20,new de(1,30))),new ue(8,24,24,22,22,new le(24,new de(1,36))),new ue(9,26,26,24,24,new le(28,new de(1,44))),new ue(10,32,32,14,14,new le(36,new de(1,62))),new ue(11,36,36,16,16,new le(42,new de(1,86))),new ue(12,40,40,18,18,new le(48,new de(1,114))),new ue(13,44,44,20,20,new le(56,new de(1,144))),new ue(14,48,48,22,22,new le(68,new de(1,174))),new ue(15,52,52,24,24,new le(42,new de(2,102))),new ue(16,64,64,14,14,new le(56,new de(2,140))),new ue(17,72,72,16,16,new le(36,new de(4,92))),new ue(18,80,80,18,18,new le(48,new de(4,114))),new ue(19,88,88,20,20,new le(56,new de(4,144))),new ue(20,96,96,22,22,new le(68,new de(4,174))),new ue(21,104,104,24,24,new le(56,new de(6,136))),new ue(22,120,120,18,18,new le(68,new de(6,175))),new ue(23,132,132,20,20,new le(62,new de(8,163))),new ue(24,144,144,22,22,new le(62,new de(8,156),new de(2,155))),new ue(25,8,18,6,16,new le(7,new de(1,5))),new ue(26,8,32,6,14,new le(11,new de(1,10))),new ue(27,12,26,10,24,new le(14,new de(1,16))),new ue(28,12,36,10,16,new le(18,new de(1,22))),new ue(29,16,36,14,16,new le(24,new de(1,32))),new ue(30,16,48,14,22,new le(28,new de(1,49)))]}}ue.VERSIONS=ue.buildVersions();class he{constructor(t){const e=t.getHeight();if(e<8||e>144||1&e)throw new v;this.version=he.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new k(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(t){const e=t.getHeight(),n=t.getWidth();return ue.getVersionForDimensions(e,n)}readCodewords(){const t=new Int8Array(this.version.getTotalCodewords());let e=0,n=4,r=0;const o=this.mappingBitMatrix.getHeight(),i=this.mappingBitMatrix.getWidth();let a=!1,s=!1,c=!1,l=!1;do{if(n!==o||0!==r||a)if(n===o-2&&0===r&&3&i&&!s)t[e++]=255&this.readCorner2(o,i),n-=2,r+=2,s=!0;else if(n!==o+4||2!==r||7&i||c)if(n!==o-2||0!==r||4!=(7&i)||l){do{n<o&&r>=0&&!this.readMappingMatrix.get(r,n)&&(t[e++]=255&this.readUtah(n,r,o,i)),n-=2,r+=2}while(n>=0&&r<i);n+=1,r+=3;do{n>=0&&r<i&&!this.readMappingMatrix.get(r,n)&&(t[e++]=255&this.readUtah(n,r,o,i)),n+=2,r-=2}while(n<o&&r>=0);n+=3,r+=1}else t[e++]=255&this.readCorner4(o,i),n-=2,r+=2,l=!0;else t[e++]=255&this.readCorner3(o,i),n-=2,r+=2,c=!0;else t[e++]=255&this.readCorner1(o,i),n-=2,r+=2,a=!0}while(n<o||r<i);if(e!==this.version.getTotalCodewords())throw new v;return t}readModule(t,e,n,r){return t<0&&(t+=n,e+=4-(n+4&7)),e<0&&(e+=r,t+=4-(r+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)}readUtah(t,e,n,r){let o=0;return this.readModule(t-2,e-2,n,r)&&(o|=1),o<<=1,this.readModule(t-2,e-1,n,r)&&(o|=1),o<<=1,this.readModule(t-1,e-2,n,r)&&(o|=1),o<<=1,this.readModule(t-1,e-1,n,r)&&(o|=1),o<<=1,this.readModule(t-1,e,n,r)&&(o|=1),o<<=1,this.readModule(t,e-2,n,r)&&(o|=1),o<<=1,this.readModule(t,e-1,n,r)&&(o|=1),o<<=1,this.readModule(t,e,n,r)&&(o|=1),o}readCorner1(t,e){let n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,1,t,e)&&(n|=1),n<<=1,this.readModule(t-1,2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n}readCorner2(t,e){let n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-4,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n}readCorner3(t,e){let n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-3,t,e)&&(n|=1),n<<=1,this.readModule(1,e-2,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n}readCorner4(t,e){let n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n}extractDataRegion(t){const e=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new d("Dimension of bitMatrix must match the version size");const r=this.version.getDataRegionSizeRows(),o=this.version.getDataRegionSizeColumns(),i=e/r|0,a=n/o|0,s=new k(a*o,i*r);for(let e=0;e<i;++e){const n=e*r;for(let i=0;i<a;++i){const a=i*o;for(let c=0;c<r;++c){const l=e*(r+2)+1+c,d=n+c;for(let e=0;e<o;++e){const n=i*(o+2)+1+e;if(t.get(n,l)){const t=a+e;s.set(t,d)}}}}}return s}}class me{constructor(t,e){this.numDataCodewords=t,this.codewords=e}static getDataBlocks(t,e){const n=e.getECBlocks();let r=0;const o=n.getECBlocks();for(let t of o)r+=t.getCount();const i=new Array(r);let a=0;for(let t of o)for(let e=0;e<t.getCount();e++){const e=t.getDataCodewords(),r=n.getECCodewords()+e;i[a++]=new me(e,new Uint8Array(r))}const s=i[0].codewords.length-n.getECCodewords(),c=s-1;let l=0;for(let e=0;e<c;e++)for(let n=0;n<a;n++)i[n].codewords[e]=t[l++];const u=24===e.getVersionNumber(),h=u?8:a;for(let e=0;e<h;e++)i[e].codewords[s-1]=t[l++];const m=i[0].codewords.length;for(let e=s;e<m;e++)for(let n=0;n<a;n++){const r=u?(n+8)%a:n,o=u&&r>7?e-1:e;i[r].codewords[o]=t[l++]}if(l!==t.length)throw new d;return i}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class fe{constructor(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(t){if(t<1||t>32||t>this.available())throw new d(""+t);let e=0,n=this.bitOffset,r=this.byteOffset;const o=this.bytes;if(n>0){const i=8-n,a=t<i?t:i,s=i-a,c=255>>8-a<<s;e=(o[r]&c)>>s,t-=a,n+=a,8===n&&(n=0,r++)}if(t>0){for(;t>=8;)e=e<<8|255&o[r],r++,t-=8;if(t>0){const i=8-t,a=255>>i<<i;e=e<<t|(o[r]&a)>>i,n+=t}}return this.bitOffset=n,this.byteOffset=r,e}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}!function(t){t[t.PAD_ENCODE=0]="PAD_ENCODE",t[t.ASCII_ENCODE=1]="ASCII_ENCODE",t[t.C40_ENCODE=2]="C40_ENCODE",t[t.TEXT_ENCODE=3]="TEXT_ENCODE",t[t.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",t[t.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",t[t.BASE256_ENCODE=6]="BASE256_ENCODE"}(U||(U={}));class pe{static decode(t){const e=new fe(t),n=new S,r=new S,o=new Array;let i=U.ASCII_ENCODE;do{if(i===U.ASCII_ENCODE)i=this.decodeAsciiSegment(e,n,r);else{switch(i){case U.C40_ENCODE:this.decodeC40Segment(e,n);break;case U.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case U.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case U.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case U.BASE256_ENCODE:this.decodeBase256Segment(e,n,o);break;default:throw new v}i=U.ASCII_ENCODE}}while(i!==U.PAD_ENCODE&&e.available()>0);return r.length()>0&&n.append(r.toString()),new Q(t,n.toString(),0===o.length?null:o,null)}static decodeAsciiSegment(t,e,n){let r=!1;do{let o=t.readBits(8);if(0===o)throw new v;if(o<=128)return r&&(o+=128),e.append(String.fromCharCode(o-1)),U.ASCII_ENCODE;if(129===o)return U.PAD_ENCODE;if(o<=229){const t=o-130;t<10&&e.append("0"),e.append(""+t)}else switch(o){case 230:return U.C40_ENCODE;case 231:return U.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:r=!0;break;case 236:e.append("[)>05"),n.insert(0,"");break;case 237:e.append("[)>06"),n.insert(0,"");break;case 238:return U.ANSIX12_ENCODE;case 239:return U.TEXT_ENCODE;case 240:return U.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new v}}while(t.available()>0);return U.ASCII_ENCODE}static decodeC40Segment(t,e){let n=!1;const r=[];let o=0;do{if(8===t.available())return;const i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),r);for(let t=0;t<3;t++){const i=r[t];switch(o){case 0:if(i<3)o=i+1;else{if(!(i<this.C40_BASIC_SET_CHARS.length))throw new v;{const t=this.C40_BASIC_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}}break;case 1:n?(e.append(String.fromCharCode(i+128)),n=!1):e.append(String.fromCharCode(i)),o=0;break;case 2:if(i<this.C40_SHIFT2_SET_CHARS.length){const t=this.C40_SHIFT2_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}else switch(i){case 27:e.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new v}o=0;break;case 3:n?(e.append(String.fromCharCode(i+224)),n=!1):e.append(String.fromCharCode(i+96)),o=0;break;default:throw new v}}}while(t.available()>0)}static decodeTextSegment(t,e){let n=!1,r=[],o=0;do{if(8===t.available())return;const i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),r);for(let t=0;t<3;t++){const i=r[t];switch(o){case 0:if(i<3)o=i+1;else{if(!(i<this.TEXT_BASIC_SET_CHARS.length))throw new v;{const t=this.TEXT_BASIC_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}}break;case 1:n?(e.append(String.fromCharCode(i+128)),n=!1):e.append(String.fromCharCode(i)),o=0;break;case 2:if(i<this.TEXT_SHIFT2_SET_CHARS.length){const t=this.TEXT_SHIFT2_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t)}else switch(i){case 27:e.append(String.fromCharCode(29));break;case 30:n=!0;break;default:throw new v}o=0;break;case 3:if(!(i<this.TEXT_SHIFT3_SET_CHARS.length))throw new v;{const t=this.TEXT_SHIFT3_SET_CHARS[i];n?(e.append(String.fromCharCode(t.charCodeAt(0)+128)),n=!1):e.append(t),o=0}break;default:throw new v}}}while(t.available()>0)}static decodeAnsiX12Segment(t,e){const n=[];do{if(8===t.available())return;const r=t.readBits(8);if(254===r)return;this.parseTwoBytes(r,t.readBits(8),n);for(let t=0;t<3;t++){const r=n[t];switch(r){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(r<14)e.append(String.fromCharCode(r+44));else{if(!(r<40))throw new v;e.append(String.fromCharCode(r+51))}}}}while(t.available()>0)}static parseTwoBytes(t,e,n){let r=(t<<8)+e-1,o=Math.floor(r/1600);n[0]=o,r-=1600*o,o=Math.floor(r/40),n[1]=o,n[2]=r-40*o}static decodeEdifactSegment(t,e){do{if(t.available()<=16)return;for(let n=0;n<4;n++){let n=t.readBits(6);if(31===n){const e=8-t.getBitOffset();return void(8!==e&&t.readBits(e))}32&n||(n|=64),e.append(String.fromCharCode(n))}}while(t.available()>0)}static decodeBase256Segment(t,e,n){let r=1+t.getByteOffset();const o=this.unrandomize255State(t.readBits(8),r++);let i;if(i=0===o?t.available()/8|0:o<250?o:250*(o-249)+this.unrandomize255State(t.readBits(8),r++),i<0)throw new v;const a=new Uint8Array(i);for(let e=0;e<i;e++){if(t.available()<8)throw new v;a[e]=this.unrandomize255State(t.readBits(8),r++)}n.push(a);try{e.append(E.decode(a,A.ISO88591))}catch(t){throw new et("Platform does not support required encoding: "+t.message)}}static unrandomize255State(t,e){const n=t-(149*e%255+1);return n>=0?n:n+256}}pe.C40_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],pe.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],pe.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],pe.TEXT_SHIFT2_SET_CHARS=pe.C40_SHIFT2_SET_CHARS,pe.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)];class _e{constructor(){this.rsDecoder=new nt(J.DATA_MATRIX_FIELD_256)}decode(t){const e=new he(t),n=e.getVersion(),r=e.readCodewords(),o=me.getDataBlocks(r,n);let i=0;for(let t of o)i+=t.getNumDataCodewords();const a=new Uint8Array(i),s=o.length;for(let t=0;t<s;t++){const e=o[t],n=e.getCodewords(),r=e.getNumDataCodewords();this.correctErrors(n,r);for(let e=0;e<r;e++)a[e*s+t]=n[e]}return pe.decode(a)}correctErrors(t,e){const n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch(t){throw new h}for(let r=0;r<e;r++)t[r]=n[r]}}class ge{constructor(t){this.image=t,this.rectangleDetector=new lt(this.image)}detect(){const t=this.rectangleDetector.detect();let e=this.detectSolid1(t);if(e=this.detectSolid2(e),e[3]=this.correctTopRight(e),!e[3])throw new T;e=this.shiftToModuleCenter(e);const n=e[0],r=e[1],o=e[2],i=e[3];let a=this.transitionsBetween(n,i)+1,s=this.transitionsBetween(o,i)+1;1&~a||(a+=1),1&~s||(s+=1),4*a<7*s&&4*s<7*a&&(a=s=Math.max(a,s));let c=ge.sampleGrid(this.image,n,r,o,i,a,s);return new st(c,[n,r,o,i])}static shiftPoint(t,e,n){let r=(e.getX()-t.getX())/(n+1),o=(e.getY()-t.getY())/(n+1);return new at(t.getX()+r,t.getY()+o)}static moveAway(t,e,n){let r=t.getX(),o=t.getY();return r<e?r-=1:r+=1,o<n?o-=1:o+=1,new at(r,o)}detectSolid1(t){let e=t[0],n=t[1],r=t[3],o=t[2],i=this.transitionsBetween(e,n),a=this.transitionsBetween(n,r),s=this.transitionsBetween(r,o),c=this.transitionsBetween(o,e),l=i,d=[o,e,n,r];return l>a&&(l=a,d[0]=e,d[1]=n,d[2]=r,d[3]=o),l>s&&(l=s,d[0]=n,d[1]=r,d[2]=o,d[3]=e),l>c&&(d[0]=r,d[1]=o,d[2]=e,d[3]=n),d}detectSolid2(t){let e=t[0],n=t[1],r=t[2],o=t[3],i=this.transitionsBetween(e,o),a=ge.shiftPoint(n,r,4*(i+1)),s=ge.shiftPoint(r,n,4*(i+1));return this.transitionsBetween(a,e)<this.transitionsBetween(s,o)?(t[0]=e,t[1]=n,t[2]=r,t[3]=o):(t[0]=n,t[1]=r,t[2]=o,t[3]=e),t}correctTopRight(t){let e=t[0],n=t[1],r=t[2],o=t[3],i=this.transitionsBetween(e,o),a=this.transitionsBetween(n,o),s=ge.shiftPoint(e,n,4*(a+1)),c=ge.shiftPoint(r,n,4*(i+1));i=this.transitionsBetween(s,o),a=this.transitionsBetween(c,o);let l=new at(o.getX()+(r.getX()-n.getX())/(i+1),o.getY()+(r.getY()-n.getY())/(i+1)),d=new at(o.getX()+(e.getX()-n.getX())/(a+1),o.getY()+(e.getY()-n.getY())/(a+1));return this.isValid(l)?this.isValid(d)?this.transitionsBetween(s,l)+this.transitionsBetween(c,l)>this.transitionsBetween(s,d)+this.transitionsBetween(c,d)?l:d:l:this.isValid(d)?d:null}shiftToModuleCenter(t){let e=t[0],n=t[1],r=t[2],o=t[3],i=this.transitionsBetween(e,o)+1,a=this.transitionsBetween(r,o)+1,s=ge.shiftPoint(e,n,4*a),c=ge.shiftPoint(r,n,4*i);i=this.transitionsBetween(s,o)+1,a=this.transitionsBetween(c,o)+1,1&~i||(i+=1),1&~a||(a+=1);let l,d,u=(e.getX()+n.getX()+r.getX()+o.getX())/4,h=(e.getY()+n.getY()+r.getY()+o.getY())/4;return e=ge.moveAway(e,u,h),n=ge.moveAway(n,u,h),r=ge.moveAway(r,u,h),o=ge.moveAway(o,u,h),s=ge.shiftPoint(e,n,4*a),s=ge.shiftPoint(s,o,4*i),l=ge.shiftPoint(n,e,4*a),l=ge.shiftPoint(l,r,4*i),c=ge.shiftPoint(r,o,4*a),c=ge.shiftPoint(c,n,4*i),d=ge.shiftPoint(o,r,4*a),d=ge.shiftPoint(d,e,4*i),[s,l,c,d]}isValid(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()}static sampleGrid(t,e,n,r,o,i,a){return mt.getInstance().sampleGrid(t,i,a,.5,.5,i-.5,.5,i-.5,a-.5,.5,a-.5,e.getX(),e.getY(),o.getX(),o.getY(),r.getX(),r.getY(),n.getX(),n.getY())}transitionsBetween(t,e){let n=Math.trunc(t.getX()),r=Math.trunc(t.getY()),o=Math.trunc(e.getX()),i=Math.trunc(e.getY()),a=Math.abs(i-r)>Math.abs(o-n);if(a){let t=n;n=r,r=t,t=o,o=i,i=t}let s=Math.abs(o-n),c=Math.abs(i-r),l=-s/2,d=r<i?1:-1,u=n<o?1:-1,h=0,m=this.image.get(a?r:n,a?n:r);for(let t=n,e=r;t!==o;t+=u){let n=this.image.get(a?e:t,a?t:e);if(n!==m&&(h++,m=n),l+=c,l>0){if(e===i)break;e+=d,l-=s}}return h}}class we{constructor(){this.decoder=new _e}decode(t,e=null){let n,r;if(null!=e&&e.has(b.PURE_BARCODE)){const e=we.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(e),r=we.NO_POINTS}else{const e=new ge(t.getBlackMatrix()).detect();n=this.decoder.decode(e.getBits()),r=e.getPoints()}const o=n.getRawBytes(),i=new L(n.getText(),o,8*o.length,r,V.DATA_MATRIX,f.currentTimeMillis()),a=n.getByteSegments();null!=a&&i.putMetadata(X.BYTE_SEGMENTS,a);const s=n.getECLevel();return null!=s&&i.putMetadata(X.ERROR_CORRECTION_LEVEL,s),i}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(null==e||null==n)throw new T;const r=this.moduleSize(e,t);let o=e[1];const i=n[1];let a=e[0];const s=(n[0]-a+1)/r,c=(i-o+1)/r;if(s<=0||c<=0)throw new T;const l=r/2;o+=l,a+=l;const d=new k(s,c);for(let e=0;e<c;e++){const n=o+e*r;for(let o=0;o<s;o++)t.get(a+o*r,n)&&d.set(o,e)}return d}static moduleSize(t,e){const n=e.getWidth();let r=t[0];const o=t[1];for(;r<n&&e.get(r,o);)r++;if(r===n)throw new T;const i=r-t[0];if(0===i)throw new T;return i}}we.NO_POINTS=[];class $e extends F{constructor(t=500){super(new we,t)}}!function(t){t[t.L=0]="L",t[t.M=1]="M",t[t.Q=2]="Q",t[t.H=3]="H"}(z||(z={}));class ye{constructor(t,e,n){this.value=t,this.stringValue=e,this.bits=n,ye.FOR_BITS.set(n,this),ye.FOR_VALUE.set(t,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(t){switch(t){case"L":return ye.L;case"M":return ye.M;case"Q":return ye.Q;case"H":return ye.H;default:throw new l(t+"not available")}}toString(){return this.stringValue}equals(t){if(!(t instanceof ye))return!1;const e=t;return this.value===e.value}static forBits(t){if(t<0||t>=ye.FOR_BITS.size)throw new d;return ye.FOR_BITS.get(t)}}ye.FOR_BITS=new Map,ye.FOR_VALUE=new Map,ye.L=new ye(z.L,"L",1),ye.M=new ye(z.M,"M",0),ye.Q=new ye(z.Q,"Q",3),ye.H=new ye(z.H,"H",2);class be{constructor(t){this.errorCorrectionLevel=ye.forBits(t>>3&3),this.dataMask=7&t}static numBitsDiffering(t,e){return w.bitCount(t^e)}static decodeFormatInformation(t,e){const n=be.doDecodeFormatInformation(t,e);return null!==n?n:be.doDecodeFormatInformation(t^be.FORMAT_INFO_MASK_QR,e^be.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(t,e){let n=Number.MAX_SAFE_INTEGER,r=0;for(const o of be.FORMAT_INFO_DECODE_LOOKUP){const i=o[0];if(i===t||i===e)return new be(o[1]);let a=be.numBitsDiffering(t,i);a<n&&(r=o[1],n=a),t!==e&&(a=be.numBitsDiffering(e,i),a<n&&(r=o[1],n=a))}return n<=3?new be(r):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(t){if(!(t instanceof be))return!1;const e=t;return this.errorCorrectionLevel===e.errorCorrectionLevel&&this.dataMask===e.dataMask}}be.FORMAT_INFO_MASK_QR=21522,be.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class ve{constructor(t,...e){this.ecCodewordsPerBlock=t,this.ecBlocks=e}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let t=0;const e=this.ecBlocks;for(const n of e)t+=n.getCount();return t}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class Ie{constructor(t,e){this.count=t,this.dataCodewords=e}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class Ce{constructor(t,e,...n){this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=n;let r=0;const o=n[0].getECCodewordsPerBlock(),i=n[0].getECBlocks();for(const t of i)r+=t.getCount()*(t.getDataCodewords()+o);this.totalCodewords=r}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(t){return this.ecBlocks[t.getValue()]}static getProvisionalVersionForDimension(t){if(t%4!=1)throw new v;try{return this.getVersionForNumber((t-17)/4)}catch(t){throw new v}}static getVersionForNumber(t){if(t<1||t>40)throw new d;return Ce.VERSIONS[t-1]}static decodeVersionInformation(t){let e=Number.MAX_SAFE_INTEGER,n=0;for(let r=0;r<Ce.VERSION_DECODE_INFO.length;r++){const o=Ce.VERSION_DECODE_INFO[r];if(o===t)return Ce.getVersionForNumber(r+7);const i=be.numBitsDiffering(t,o);i<e&&(n=r+7,e=i)}return e<=3?Ce.getVersionForNumber(n):null}buildFunctionPattern(){const t=this.getDimensionForVersion(),e=new k(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);const n=this.alignmentPatternCenters.length;for(let t=0;t<n;t++){const r=this.alignmentPatternCenters[t]-2;for(let o=0;o<n;o++)0===t&&(0===o||o===n-1)||t===n-1&&0===o||e.setRegion(this.alignmentPatternCenters[o]-2,r,5,5)}return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e}toString(){return""+this.versionNumber}}Ce.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),Ce.VERSIONS=[new Ce(1,new Int32Array(0),new ve(7,new Ie(1,19)),new ve(10,new Ie(1,16)),new ve(13,new Ie(1,13)),new ve(17,new Ie(1,9))),new Ce(2,Int32Array.from([6,18]),new ve(10,new Ie(1,34)),new ve(16,new Ie(1,28)),new ve(22,new Ie(1,22)),new ve(28,new Ie(1,16))),new Ce(3,Int32Array.from([6,22]),new ve(15,new Ie(1,55)),new ve(26,new Ie(1,44)),new ve(18,new Ie(2,17)),new ve(22,new Ie(2,13))),new Ce(4,Int32Array.from([6,26]),new ve(20,new Ie(1,80)),new ve(18,new Ie(2,32)),new ve(26,new Ie(2,24)),new ve(16,new Ie(4,9))),new Ce(5,Int32Array.from([6,30]),new ve(26,new Ie(1,108)),new ve(24,new Ie(2,43)),new ve(18,new Ie(2,15),new Ie(2,16)),new ve(22,new Ie(2,11),new Ie(2,12))),new Ce(6,Int32Array.from([6,34]),new ve(18,new Ie(2,68)),new ve(16,new Ie(4,27)),new ve(24,new Ie(4,19)),new ve(28,new Ie(4,15))),new Ce(7,Int32Array.from([6,22,38]),new ve(20,new Ie(2,78)),new ve(18,new Ie(4,31)),new ve(18,new Ie(2,14),new Ie(4,15)),new ve(26,new Ie(4,13),new Ie(1,14))),new Ce(8,Int32Array.from([6,24,42]),new ve(24,new Ie(2,97)),new ve(22,new Ie(2,38),new Ie(2,39)),new ve(22,new Ie(4,18),new Ie(2,19)),new ve(26,new Ie(4,14),new Ie(2,15))),new Ce(9,Int32Array.from([6,26,46]),new ve(30,new Ie(2,116)),new ve(22,new Ie(3,36),new Ie(2,37)),new ve(20,new Ie(4,16),new Ie(4,17)),new ve(24,new Ie(4,12),new Ie(4,13))),new Ce(10,Int32Array.from([6,28,50]),new ve(18,new Ie(2,68),new Ie(2,69)),new ve(26,new Ie(4,43),new Ie(1,44)),new ve(24,new Ie(6,19),new Ie(2,20)),new ve(28,new Ie(6,15),new Ie(2,16))),new Ce(11,Int32Array.from([6,30,54]),new ve(20,new Ie(4,81)),new ve(30,new Ie(1,50),new Ie(4,51)),new ve(28,new Ie(4,22),new Ie(4,23)),new ve(24,new Ie(3,12),new Ie(8,13))),new Ce(12,Int32Array.from([6,32,58]),new ve(24,new Ie(2,92),new Ie(2,93)),new ve(22,new Ie(6,36),new Ie(2,37)),new ve(26,new Ie(4,20),new Ie(6,21)),new ve(28,new Ie(7,14),new Ie(4,15))),new Ce(13,Int32Array.from([6,34,62]),new ve(26,new Ie(4,107)),new ve(22,new Ie(8,37),new Ie(1,38)),new ve(24,new Ie(8,20),new Ie(4,21)),new ve(22,new Ie(12,11),new Ie(4,12))),new Ce(14,Int32Array.from([6,26,46,66]),new ve(30,new Ie(3,115),new Ie(1,116)),new ve(24,new Ie(4,40),new Ie(5,41)),new ve(20,new Ie(11,16),new Ie(5,17)),new ve(24,new Ie(11,12),new Ie(5,13))),new Ce(15,Int32Array.from([6,26,48,70]),new ve(22,new Ie(5,87),new Ie(1,88)),new ve(24,new Ie(5,41),new Ie(5,42)),new ve(30,new Ie(5,24),new Ie(7,25)),new ve(24,new Ie(11,12),new Ie(7,13))),new Ce(16,Int32Array.from([6,26,50,74]),new ve(24,new Ie(5,98),new Ie(1,99)),new ve(28,new Ie(7,45),new Ie(3,46)),new ve(24,new Ie(15,19),new Ie(2,20)),new ve(30,new Ie(3,15),new Ie(13,16))),new Ce(17,Int32Array.from([6,30,54,78]),new ve(28,new Ie(1,107),new Ie(5,108)),new ve(28,new Ie(10,46),new Ie(1,47)),new ve(28,new Ie(1,22),new Ie(15,23)),new ve(28,new Ie(2,14),new Ie(17,15))),new Ce(18,Int32Array.from([6,30,56,82]),new ve(30,new Ie(5,120),new Ie(1,121)),new ve(26,new Ie(9,43),new Ie(4,44)),new ve(28,new Ie(17,22),new Ie(1,23)),new ve(28,new Ie(2,14),new Ie(19,15))),new Ce(19,Int32Array.from([6,30,58,86]),new ve(28,new Ie(3,113),new Ie(4,114)),new ve(26,new Ie(3,44),new Ie(11,45)),new ve(26,new Ie(17,21),new Ie(4,22)),new ve(26,new Ie(9,13),new Ie(16,14))),new Ce(20,Int32Array.from([6,34,62,90]),new ve(28,new Ie(3,107),new Ie(5,108)),new ve(26,new Ie(3,41),new Ie(13,42)),new ve(30,new Ie(15,24),new Ie(5,25)),new ve(28,new Ie(15,15),new Ie(10,16))),new Ce(21,Int32Array.from([6,28,50,72,94]),new ve(28,new Ie(4,116),new Ie(4,117)),new ve(26,new Ie(17,42)),new ve(28,new Ie(17,22),new Ie(6,23)),new ve(30,new Ie(19,16),new Ie(6,17))),new Ce(22,Int32Array.from([6,26,50,74,98]),new ve(28,new Ie(2,111),new Ie(7,112)),new ve(28,new Ie(17,46)),new ve(30,new Ie(7,24),new Ie(16,25)),new ve(24,new Ie(34,13))),new Ce(23,Int32Array.from([6,30,54,78,102]),new ve(30,new Ie(4,121),new Ie(5,122)),new ve(28,new Ie(4,47),new Ie(14,48)),new ve(30,new Ie(11,24),new Ie(14,25)),new ve(30,new Ie(16,15),new Ie(14,16))),new Ce(24,Int32Array.from([6,28,54,80,106]),new ve(30,new Ie(6,117),new Ie(4,118)),new ve(28,new Ie(6,45),new Ie(14,46)),new ve(30,new Ie(11,24),new Ie(16,25)),new ve(30,new Ie(30,16),new Ie(2,17))),new Ce(25,Int32Array.from([6,32,58,84,110]),new ve(26,new Ie(8,106),new Ie(4,107)),new ve(28,new Ie(8,47),new Ie(13,48)),new ve(30,new Ie(7,24),new Ie(22,25)),new ve(30,new Ie(22,15),new Ie(13,16))),new Ce(26,Int32Array.from([6,30,58,86,114]),new ve(28,new Ie(10,114),new Ie(2,115)),new ve(28,new Ie(19,46),new Ie(4,47)),new ve(28,new Ie(28,22),new Ie(6,23)),new ve(30,new Ie(33,16),new Ie(4,17))),new Ce(27,Int32Array.from([6,34,62,90,118]),new ve(30,new Ie(8,122),new Ie(4,123)),new ve(28,new Ie(22,45),new Ie(3,46)),new ve(30,new Ie(8,23),new Ie(26,24)),new ve(30,new Ie(12,15),new Ie(28,16))),new Ce(28,Int32Array.from([6,26,50,74,98,122]),new ve(30,new Ie(3,117),new Ie(10,118)),new ve(28,new Ie(3,45),new Ie(23,46)),new ve(30,new Ie(4,24),new Ie(31,25)),new ve(30,new Ie(11,15),new Ie(31,16))),new Ce(29,Int32Array.from([6,30,54,78,102,126]),new ve(30,new Ie(7,116),new Ie(7,117)),new ve(28,new Ie(21,45),new Ie(7,46)),new ve(30,new Ie(1,23),new Ie(37,24)),new ve(30,new Ie(19,15),new Ie(26,16))),new Ce(30,Int32Array.from([6,26,52,78,104,130]),new ve(30,new Ie(5,115),new Ie(10,116)),new ve(28,new Ie(19,47),new Ie(10,48)),new ve(30,new Ie(15,24),new Ie(25,25)),new ve(30,new Ie(23,15),new Ie(25,16))),new Ce(31,Int32Array.from([6,30,56,82,108,134]),new ve(30,new Ie(13,115),new Ie(3,116)),new ve(28,new Ie(2,46),new Ie(29,47)),new ve(30,new Ie(42,24),new Ie(1,25)),new ve(30,new Ie(23,15),new Ie(28,16))),new Ce(32,Int32Array.from([6,34,60,86,112,138]),new ve(30,new Ie(17,115)),new ve(28,new Ie(10,46),new Ie(23,47)),new ve(30,new Ie(10,24),new Ie(35,25)),new ve(30,new Ie(19,15),new Ie(35,16))),new Ce(33,Int32Array.from([6,30,58,86,114,142]),new ve(30,new Ie(17,115),new Ie(1,116)),new ve(28,new Ie(14,46),new Ie(21,47)),new ve(30,new Ie(29,24),new Ie(19,25)),new ve(30,new Ie(11,15),new Ie(46,16))),new Ce(34,Int32Array.from([6,34,62,90,118,146]),new ve(30,new Ie(13,115),new Ie(6,116)),new ve(28,new Ie(14,46),new Ie(23,47)),new ve(30,new Ie(44,24),new Ie(7,25)),new ve(30,new Ie(59,16),new Ie(1,17))),new Ce(35,Int32Array.from([6,30,54,78,102,126,150]),new ve(30,new Ie(12,121),new Ie(7,122)),new ve(28,new Ie(12,47),new Ie(26,48)),new ve(30,new Ie(39,24),new Ie(14,25)),new ve(30,new Ie(22,15),new Ie(41,16))),new Ce(36,Int32Array.from([6,24,50,76,102,128,154]),new ve(30,new Ie(6,121),new Ie(14,122)),new ve(28,new Ie(6,47),new Ie(34,48)),new ve(30,new Ie(46,24),new Ie(10,25)),new ve(30,new Ie(2,15),new Ie(64,16))),new Ce(37,Int32Array.from([6,28,54,80,106,132,158]),new ve(30,new Ie(17,122),new Ie(4,123)),new ve(28,new Ie(29,46),new Ie(14,47)),new ve(30,new Ie(49,24),new Ie(10,25)),new ve(30,new Ie(24,15),new Ie(46,16))),new Ce(38,Int32Array.from([6,32,58,84,110,136,162]),new ve(30,new Ie(4,122),new Ie(18,123)),new ve(28,new Ie(13,46),new Ie(32,47)),new ve(30,new Ie(48,24),new Ie(14,25)),new ve(30,new Ie(42,15),new Ie(32,16))),new Ce(39,Int32Array.from([6,26,54,82,110,138,166]),new ve(30,new Ie(20,117),new Ie(4,118)),new ve(28,new Ie(40,47),new Ie(7,48)),new ve(30,new Ie(43,24),new Ie(22,25)),new ve(30,new Ie(10,15),new Ie(67,16))),new Ce(40,Int32Array.from([6,30,58,86,114,142,170]),new ve(30,new Ie(19,118),new Ie(6,119)),new ve(28,new Ie(18,47),new Ie(31,48)),new ve(30,new Ie(34,24),new Ie(34,25)),new ve(30,new Ie(20,15),new Ie(61,16)))],function(t){t[t.DATA_MASK_000=0]="DATA_MASK_000",t[t.DATA_MASK_001=1]="DATA_MASK_001",t[t.DATA_MASK_010=2]="DATA_MASK_010",t[t.DATA_MASK_011=3]="DATA_MASK_011",t[t.DATA_MASK_100=4]="DATA_MASK_100",t[t.DATA_MASK_101=5]="DATA_MASK_101",t[t.DATA_MASK_110=6]="DATA_MASK_110",t[t.DATA_MASK_111=7]="DATA_MASK_111"}(W||(W={}));class Ee{constructor(t,e){this.value=t,this.isMasked=e}unmaskBitMatrix(t,e){for(let n=0;n<e;n++)for(let r=0;r<e;r++)this.isMasked(n,r)&&t.flip(r,n)}}Ee.values=new Map([[W.DATA_MASK_000,new Ee(W.DATA_MASK_000,(t,e)=>!(t+e&1))],[W.DATA_MASK_001,new Ee(W.DATA_MASK_001,(t,e)=>!(1&t))],[W.DATA_MASK_010,new Ee(W.DATA_MASK_010,(t,e)=>e%3==0)],[W.DATA_MASK_011,new Ee(W.DATA_MASK_011,(t,e)=>(t+e)%3==0)],[W.DATA_MASK_100,new Ee(W.DATA_MASK_100,(t,e)=>!(Math.floor(t/2)+Math.floor(e/3)&1))],[W.DATA_MASK_101,new Ee(W.DATA_MASK_101,(t,e)=>t*e%6==0)],[W.DATA_MASK_110,new Ee(W.DATA_MASK_110,(t,e)=>t*e%6<3)],[W.DATA_MASK_111,new Ee(W.DATA_MASK_111,(t,e)=>!(t+e+t*e%3&1))]]);class Ae{constructor(t){const e=t.getHeight();if(e<21||1!=(3&e))throw new v;this.bitMatrix=t}readFormatInformation(){if(null!==this.parsedFormatInfo&&void 0!==this.parsedFormatInfo)return this.parsedFormatInfo;let t=0;for(let e=0;e<6;e++)t=this.copyBit(e,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(let e=5;e>=0;e--)t=this.copyBit(8,e,t);const e=this.bitMatrix.getHeight();let n=0;const r=e-7;for(let t=e-1;t>=r;t--)n=this.copyBit(8,t,n);for(let t=e-8;t<e;t++)n=this.copyBit(t,8,n);if(this.parsedFormatInfo=be.decodeFormatInformation(t,n),null!==this.parsedFormatInfo)return this.parsedFormatInfo;throw new v}readVersion(){if(null!==this.parsedVersion&&void 0!==this.parsedVersion)return this.parsedVersion;const t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return Ce.getVersionForNumber(e);let n=0;const r=t-11;for(let e=5;e>=0;e--)for(let o=t-9;o>=r;o--)n=this.copyBit(o,e,n);let o=Ce.decodeVersionInformation(n);if(null!==o&&o.getDimensionForVersion()===t)return this.parsedVersion=o,o;n=0;for(let e=5;e>=0;e--)for(let o=t-9;o>=r;o--)n=this.copyBit(e,o,n);if(o=Ce.decodeVersionInformation(n),null!==o&&o.getDimensionForVersion()===t)return this.parsedVersion=o,o;throw new v}copyBit(t,e,n){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?n<<1|1:n<<1}readCodewords(){const t=this.readFormatInformation(),e=this.readVersion(),n=Ee.values.get(t.getDataMask()),r=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);const o=e.buildFunctionPattern();let i=!0;const a=new Uint8Array(e.getTotalCodewords());let s=0,c=0,l=0;for(let t=r-1;t>0;t-=2){6===t&&t--;for(let e=0;e<r;e++){const n=i?r-1-e:e;for(let e=0;e<2;e++)o.get(t-e,n)||(l++,c<<=1,this.bitMatrix.get(t-e,n)&&(c|=1),8===l&&(a[s++]=c,l=0,c=0))}i=!i}if(s!==e.getTotalCodewords())throw new v;return a}remask(){if(null===this.parsedFormatInfo)return;const t=Ee.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}setMirror(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t}mirror(){const t=this.bitMatrix;for(let e=0,n=t.getWidth();e<n;e++)for(let n=e+1,r=t.getHeight();n<r;n++)t.get(e,n)!==t.get(n,e)&&(t.flip(n,e),t.flip(e,n))}}class Se{constructor(t,e){this.numDataCodewords=t,this.codewords=e}static getDataBlocks(t,e,n){if(t.length!==e.getTotalCodewords())throw new d;const r=e.getECBlocksForLevel(n);let o=0;const i=r.getECBlocks();for(const t of i)o+=t.getCount();const a=new Array(o);let s=0;for(const t of i)for(let e=0;e<t.getCount();e++){const e=t.getDataCodewords(),n=r.getECCodewordsPerBlock()+e;a[s++]=new Se(e,new Uint8Array(n))}const c=a[0].codewords.length;let l=a.length-1;for(;l>=0&&a[l].codewords.length!==c;)l--;l++;const u=c-r.getECCodewordsPerBlock();let h=0;for(let e=0;e<u;e++)for(let n=0;n<s;n++)a[n].codewords[e]=t[h++];for(let e=l;e<s;e++)a[e].codewords[u]=t[h++];const m=a[0].codewords.length;for(let e=u;e<m;e++)for(let n=0;n<s;n++){const r=n<l?e:e+1;a[n].codewords[r]=t[h++]}return a}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}!function(t){t[t.TERMINATOR=0]="TERMINATOR",t[t.NUMERIC=1]="NUMERIC",t[t.ALPHANUMERIC=2]="ALPHANUMERIC",t[t.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",t[t.BYTE=4]="BYTE",t[t.ECI=5]="ECI",t[t.KANJI=6]="KANJI",t[t.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",t[t.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",t[t.HANZI=9]="HANZI"}(j||(j={}));class ke{constructor(t,e,n,r){this.value=t,this.stringValue=e,this.characterCountBitsForVersions=n,this.bits=r,ke.FOR_BITS.set(r,this),ke.FOR_VALUE.set(t,this)}static forBits(t){const e=ke.FOR_BITS.get(t);if(void 0===e)throw new d;return e}getCharacterCountBits(t){const e=t.getVersionNumber();let n;return n=e<=9?0:e<=26?1:2,this.characterCountBitsForVersions[n]}getValue(){return this.value}getBits(){return this.bits}equals(t){if(!(t instanceof ke))return!1;const e=t;return this.value===e.value}toString(){return this.stringValue}}ke.FOR_BITS=new Map,ke.FOR_VALUE=new Map,ke.TERMINATOR=new ke(j.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),ke.NUMERIC=new ke(j.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),ke.ALPHANUMERIC=new ke(j.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),ke.STRUCTURED_APPEND=new ke(j.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),ke.BYTE=new ke(j.BYTE,"BYTE",Int32Array.from([8,16,16]),4),ke.ECI=new ke(j.ECI,"ECI",Int32Array.from([0,0,0]),7),ke.KANJI=new ke(j.KANJI,"KANJI",Int32Array.from([8,10,12]),8),ke.FNC1_FIRST_POSITION=new ke(j.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),ke.FNC1_SECOND_POSITION=new ke(j.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),ke.HANZI=new ke(j.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class Te{static decode(t,e,n,r){const o=new fe(t);let i=new S;const a=new Array;let s=-1,c=-1;try{let t,n=null,l=!1;do{if(o.available()<4)t=ke.TERMINATOR;else{const e=o.readBits(4);t=ke.forBits(e)}switch(t){case ke.TERMINATOR:break;case ke.FNC1_FIRST_POSITION:case ke.FNC1_SECOND_POSITION:l=!0;break;case ke.STRUCTURED_APPEND:if(o.available()<16)throw new v;s=o.readBits(8),c=o.readBits(8);break;case ke.ECI:const d=Te.parseECIValue(o);if(n=I.getCharacterSetECIByValue(d),null===n)throw new v;break;case ke.HANZI:const u=o.readBits(4),h=o.readBits(t.getCharacterCountBits(e));u===Te.GB2312_SUBSET&&Te.decodeHanziSegment(o,i,h);break;default:const m=o.readBits(t.getCharacterCountBits(e));switch(t){case ke.NUMERIC:Te.decodeNumericSegment(o,i,m);break;case ke.ALPHANUMERIC:Te.decodeAlphanumericSegment(o,i,m,l);break;case ke.BYTE:Te.decodeByteSegment(o,i,m,n,a,r);break;case ke.KANJI:Te.decodeKanjiSegment(o,i,m);break;default:throw new v}}}while(t!==ke.TERMINATOR)}catch(t){throw new v}return new Q(t,i.toString(),0===a.length?null:a,null===n?null:n.toString(),s,c)}static decodeHanziSegment(t,e,n){if(13*n>t.available())throw new v;const r=new Uint8Array(2*n);let o=0;for(;n>0;){const e=t.readBits(13);let i=e/96<<8&4294967295|e%96;i+=i<959?41377:42657,r[o]=i>>8&255,r[o+1]=255&i,o+=2,n--}try{e.append(E.decode(r,A.GB2312))}catch(t){throw new v(t)}}static decodeKanjiSegment(t,e,n){if(13*n>t.available())throw new v;const r=new Uint8Array(2*n);let o=0;for(;n>0;){const e=t.readBits(13);let i=e/192<<8&4294967295|e%192;i+=i<7936?33088:49472,r[o]=i>>8,r[o+1]=i,o+=2,n--}try{e.append(E.decode(r,A.SHIFT_JIS))}catch(t){throw new v(t)}}static decodeByteSegment(t,e,n,r,o,i){if(8*n>t.available())throw new v;const a=new Uint8Array(n);for(let e=0;e<n;e++)a[e]=t.readBits(8);let s;s=null===r?A.guessEncoding(a,i):r.getName();try{e.append(E.decode(a,s))}catch(t){throw new v(t)}o.push(a)}static toAlphaNumericChar(t){if(t>=Te.ALPHANUMERIC_CHARS.length)throw new v;return Te.ALPHANUMERIC_CHARS[t]}static decodeAlphanumericSegment(t,e,n,r){const o=e.length();for(;n>1;){if(t.available()<11)throw new v;const r=t.readBits(11);e.append(Te.toAlphaNumericChar(Math.floor(r/45))),e.append(Te.toAlphaNumericChar(r%45)),n-=2}if(1===n){if(t.available()<6)throw new v;e.append(Te.toAlphaNumericChar(t.readBits(6)))}if(r)for(let t=o;t<e.length();t++)"%"===e.charAt(t)&&(t<e.length()-1&&"%"===e.charAt(t+1)?e.deleteCharAt(t+1):e.setCharAt(t,String.fromCharCode(29)))}static decodeNumericSegment(t,e,n){for(;n>=3;){if(t.available()<10)throw new v;const r=t.readBits(10);if(r>=1e3)throw new v;e.append(Te.toAlphaNumericChar(Math.floor(r/100))),e.append(Te.toAlphaNumericChar(Math.floor(r/10)%10)),e.append(Te.toAlphaNumericChar(r%10)),n-=3}if(2===n){if(t.available()<7)throw new v;const n=t.readBits(7);if(n>=100)throw new v;e.append(Te.toAlphaNumericChar(Math.floor(n/10))),e.append(Te.toAlphaNumericChar(n%10))}else if(1===n){if(t.available()<4)throw new v;const n=t.readBits(4);if(n>=10)throw new v;e.append(Te.toAlphaNumericChar(n))}}static parseECIValue(t){const e=t.readBits(8);if(!(128&e))return 127&e;if(128==(192&e))return(63&e)<<8&4294967295|t.readBits(8);if(192==(224&e))return(31&e)<<16&4294967295|t.readBits(16);throw new v}}Te.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",Te.GB2312_SUBSET=1;class Re{constructor(t){this.mirrored=t}isMirrored(){return this.mirrored}applyMirroredCorrection(t){if(!this.mirrored||null===t||t.length<3)return;const e=t[0];t[0]=t[2],t[2]=e}}class Ne{constructor(){this.rsDecoder=new nt(J.QR_CODE_FIELD_256)}decodeBooleanArray(t,e){return this.decodeBitMatrix(k.parseFromBooleanArray(t),e)}decodeBitMatrix(t,e){const n=new Ae(t);let r=null;try{return this.decodeBitMatrixParser(n,e)}catch(t){r=t}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();const t=this.decodeBitMatrixParser(n,e);return t.setOther(new Re(!0)),t}catch(t){if(null!==r)throw r;throw t}}decodeBitMatrixParser(t,e){const n=t.readVersion(),r=t.readFormatInformation().getErrorCorrectionLevel(),o=t.readCodewords(),i=Se.getDataBlocks(o,n,r);let a=0;for(const t of i)a+=t.getNumDataCodewords();const s=new Uint8Array(a);let c=0;for(const t of i){const e=t.getCodewords(),n=t.getNumDataCodewords();this.correctErrors(e,n);for(let t=0;t<n;t++)s[c++]=e[t]}return Te.decode(s,n,r,e)}correctErrors(t,e){const n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch(t){throw new h}for(let r=0;r<e;r++)t[r]=n[r]}}class De extends at{constructor(t,e,n){super(t,e),this.estimatedModuleSize=n}aboutEquals(t,e,n){if(Math.abs(e-this.getY())<=t&&Math.abs(n-this.getX())<=t){const e=Math.abs(t-this.estimatedModuleSize);return e<=1||e<=this.estimatedModuleSize}return!1}combineEstimate(t,e,n){const r=(this.getX()+e)/2,o=(this.getY()+t)/2,i=(this.estimatedModuleSize+n)/2;return new De(r,o,i)}}class xe{constructor(t,e,n,r,o,i,a){this.image=t,this.startX=e,this.startY=n,this.width=r,this.height=o,this.moduleSize=i,this.resultPointCallback=a,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const t=this.startX,e=this.height,n=t+this.width,r=this.startY+e/2,o=new Int32Array(3),i=this.image;for(let a=0;a<e;a++){const e=r+(1&a?-Math.floor((a+1)/2):Math.floor((a+1)/2));o[0]=0,o[1]=0,o[2]=0;let s=t;for(;s<n&&!i.get(s,e);)s++;let c=0;for(;s<n;){if(i.get(s,e))if(1===c)o[1]++;else if(2===c){if(this.foundPatternCross(o)){const t=this.handlePossibleCenter(o,e,s);if(null!==t)return t}o[0]=o[2],o[1]=1,o[2]=0,c=1}else o[++c]++;else 1===c&&c++,o[c]++;s++}if(this.foundPatternCross(o)){const t=this.handlePossibleCenter(o,e,n);if(null!==t)return t}}if(0!==this.possibleCenters.length)return this.possibleCenters[0];throw new T}static centerFromEnd(t,e){return e-t[2]-t[1]/2}foundPatternCross(t){const e=this.moduleSize,n=e/2;for(let r=0;r<3;r++)if(Math.abs(e-t[r])>=n)return!1;return!0}crossCheckVertical(t,e,n,r){const o=this.image,i=o.getHeight(),a=this.crossCheckStateCount;a[0]=0,a[1]=0,a[2]=0;let s=t;for(;s>=0&&o.get(e,s)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&!o.get(e,s)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<i&&o.get(e,s)&&a[1]<=n;)a[1]++,s++;if(s===i||a[1]>n)return NaN;for(;s<i&&!o.get(e,s)&&a[2]<=n;)a[2]++,s++;if(a[2]>n)return NaN;const c=a[0]+a[1]+a[2];return 5*Math.abs(c-r)>=2*r?NaN:this.foundPatternCross(a)?xe.centerFromEnd(a,s):NaN}handlePossibleCenter(t,e,n){const r=t[0]+t[1]+t[2],o=xe.centerFromEnd(t,n),i=this.crossCheckVertical(e,o,2*t[1],r);if(!isNaN(i)){const e=(t[0]+t[1]+t[2])/3;for(const t of this.possibleCenters)if(t.aboutEquals(e,i,o))return t.combineEstimate(i,o,e);const n=new De(o,i,e);this.possibleCenters.push(n),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(n)}return null}}class Oe extends at{constructor(t,e,n,r){super(t,e),this.estimatedModuleSize=n,this.count=r,void 0===r&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(t,e,n){if(Math.abs(e-this.getY())<=t&&Math.abs(n-this.getX())<=t){const e=Math.abs(t-this.estimatedModuleSize);return e<=1||e<=this.estimatedModuleSize}return!1}combineEstimate(t,e,n){const r=this.count+1,o=(this.count*this.getX()+e)/r,i=(this.count*this.getY()+t)/r,a=(this.count*this.estimatedModuleSize+n)/r;return new Oe(o,i,a,r)}}class Me{constructor(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Pe{constructor(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(t){const e=null!=t&&void 0!==t.get(b.TRY_HARDER),n=null!=t&&void 0!==t.get(b.PURE_BARCODE),r=this.image,o=r.getHeight(),i=r.getWidth();let a=Math.floor(3*o/(4*Pe.MAX_MODULES));(a<Pe.MIN_SKIP||e)&&(a=Pe.MIN_SKIP);let s=!1;const c=new Int32Array(5);for(let t=a-1;t<o&&!s;t+=a){c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0;let e=0;for(let o=0;o<i;o++)if(r.get(o,t))1&~e||e++,c[e]++;else if(1&e)c[e]++;else if(4===e)if(Pe.foundPatternCross(c)){if(!0!==this.handlePossibleCenter(c,t,o,n)){c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,e=3;continue}if(a=2,!0===this.hasSkipped)s=this.haveMultiplyConfirmedCenters();else{const e=this.findRowSkip();e>c[2]&&(t+=e-c[2]-a,o=i-1)}e=0,c[0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,e=3;else c[++e]++;Pe.foundPatternCross(c)&&!0===this.handlePossibleCenter(c,t,i,n)&&(a=c[0],this.hasSkipped&&(s=this.haveMultiplyConfirmedCenters()))}const l=this.selectBestPatterns();return at.orderBestPatterns(l),new Me(l)}static centerFromEnd(t,e){return e-t[4]-t[3]-t[2]/2}static foundPatternCross(t){let e=0;for(let n=0;n<5;n++){const r=t[n];if(0===r)return!1;e+=r}if(e<7)return!1;const n=e/7,r=n/2;return Math.abs(n-t[0])<r&&Math.abs(n-t[1])<r&&Math.abs(3*n-t[2])<3*r&&Math.abs(n-t[3])<r&&Math.abs(n-t[4])<r}getCrossCheckStateCount(){const t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t}crossCheckDiagonal(t,e,n,r){const o=this.getCrossCheckStateCount();let i=0;const a=this.image;for(;t>=i&&e>=i&&a.get(e-i,t-i);)o[2]++,i++;if(t<i||e<i)return!1;for(;t>=i&&e>=i&&!a.get(e-i,t-i)&&o[1]<=n;)o[1]++,i++;if(t<i||e<i||o[1]>n)return!1;for(;t>=i&&e>=i&&a.get(e-i,t-i)&&o[0]<=n;)o[0]++,i++;if(o[0]>n)return!1;const s=a.getHeight(),c=a.getWidth();for(i=1;t+i<s&&e+i<c&&a.get(e+i,t+i);)o[2]++,i++;if(t+i>=s||e+i>=c)return!1;for(;t+i<s&&e+i<c&&!a.get(e+i,t+i)&&o[3]<n;)o[3]++,i++;if(t+i>=s||e+i>=c||o[3]>=n)return!1;for(;t+i<s&&e+i<c&&a.get(e+i,t+i)&&o[4]<n;)o[4]++,i++;if(o[4]>=n)return!1;const l=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(l-r)<2*r&&Pe.foundPatternCross(o)}crossCheckVertical(t,e,n,r){const o=this.image,i=o.getHeight(),a=this.getCrossCheckStateCount();let s=t;for(;s>=0&&o.get(e,s);)a[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(e,s)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&o.get(e,s)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<i&&o.get(e,s);)a[2]++,s++;if(s===i)return NaN;for(;s<i&&!o.get(e,s)&&a[3]<n;)a[3]++,s++;if(s===i||a[3]>=n)return NaN;for(;s<i&&o.get(e,s)&&a[4]<n;)a[4]++,s++;if(a[4]>=n)return NaN;const c=a[0]+a[1]+a[2]+a[3]+a[4];return 5*Math.abs(c-r)>=2*r?NaN:Pe.foundPatternCross(a)?Pe.centerFromEnd(a,s):NaN}crossCheckHorizontal(t,e,n,r){const o=this.image,i=o.getWidth(),a=this.getCrossCheckStateCount();let s=t;for(;s>=0&&o.get(s,e);)a[2]++,s--;if(s<0)return NaN;for(;s>=0&&!o.get(s,e)&&a[1]<=n;)a[1]++,s--;if(s<0||a[1]>n)return NaN;for(;s>=0&&o.get(s,e)&&a[0]<=n;)a[0]++,s--;if(a[0]>n)return NaN;for(s=t+1;s<i&&o.get(s,e);)a[2]++,s++;if(s===i)return NaN;for(;s<i&&!o.get(s,e)&&a[3]<n;)a[3]++,s++;if(s===i||a[3]>=n)return NaN;for(;s<i&&o.get(s,e)&&a[4]<n;)a[4]++,s++;if(a[4]>=n)return NaN;const c=a[0]+a[1]+a[2]+a[3]+a[4];return 5*Math.abs(c-r)>=r?NaN:Pe.foundPatternCross(a)?Pe.centerFromEnd(a,s):NaN}handlePossibleCenter(t,e,n,r){const o=t[0]+t[1]+t[2]+t[3]+t[4];let i=Pe.centerFromEnd(t,n),a=this.crossCheckVertical(e,Math.floor(i),t[2],o);if(!isNaN(a)&&(i=this.crossCheckHorizontal(Math.floor(i),Math.floor(a),t[2],o),!isNaN(i)&&(!r||this.crossCheckDiagonal(Math.floor(a),Math.floor(i),t[2],o)))){const t=o/7;let e=!1;const n=this.possibleCenters;for(let r=0,o=n.length;r<o;r++){const o=n[r];if(o.aboutEquals(t,a,i)){n[r]=o.combineEstimate(a,i,t),e=!0;break}}if(!e){const e=new Oe(i,a,t);n.push(e),null!==this.resultPointCallback&&void 0!==this.resultPointCallback&&this.resultPointCallback.foundPossibleResultPoint(e)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let t=null;for(const e of this.possibleCenters)if(e.getCount()>=Pe.CENTER_QUORUM){if(null!=t)return this.hasSkipped=!0,Math.floor((Math.abs(t.getX()-e.getX())-Math.abs(t.getY()-e.getY()))/2);t=e}return 0}haveMultiplyConfirmedCenters(){let t=0,e=0;const n=this.possibleCenters.length;for(const n of this.possibleCenters)n.getCount()>=Pe.CENTER_QUORUM&&(t++,e+=n.getEstimatedModuleSize());if(t<3)return!1;const r=e/n;let o=0;for(const t of this.possibleCenters)o+=Math.abs(t.getEstimatedModuleSize()-r);return o<=.05*e}selectBestPatterns(){const t=this.possibleCenters.length;if(t<3)throw new T;const e=this.possibleCenters;let n;if(t>3){let r=0,o=0;for(const t of this.possibleCenters){const e=t.getEstimatedModuleSize();r+=e,o+=e*e}n=r/t;let i=Math.sqrt(o/t-n*n);e.sort((t,e)=>{const r=Math.abs(e.getEstimatedModuleSize()-n),o=Math.abs(t.getEstimatedModuleSize()-n);return r<o?-1:r>o?1:0});const a=Math.max(.2*n,i);for(let t=0;t<e.length&&e.length>3;t++){const r=e[t];Math.abs(r.getEstimatedModuleSize()-n)>a&&(e.splice(t,1),t--)}}if(e.length>3){let t=0;for(const n of e)t+=n.getEstimatedModuleSize();n=t/e.length,e.sort((t,e)=>{if(e.getCount()===t.getCount()){const r=Math.abs(e.getEstimatedModuleSize()-n),o=Math.abs(t.getEstimatedModuleSize()-n);return r<o?1:r>o?-1:0}return e.getCount()-t.getCount()}),e.splice(3)}return[e[0],e[1],e[2]]}}Pe.CENTER_QUORUM=2,Pe.MIN_SKIP=3,Pe.MAX_MODULES=57;class Be{constructor(t){this.image=t}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(t){this.resultPointCallback=null==t?null:t.get(b.NEED_RESULT_POINT_CALLBACK);const e=new Pe(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(e)}processFinderPatternInfo(t){const e=t.getTopLeft(),n=t.getTopRight(),r=t.getBottomLeft(),o=this.calculateModuleSize(e,n,r);if(o<1)throw new T("No pattern found in proccess finder.");const i=Be.computeDimension(e,n,r,o),a=Ce.getProvisionalVersionForDimension(i),s=a.getDimensionForVersion()-7;let c=null;if(a.getAlignmentPatternCenters().length>0){const t=n.getX()-e.getX()+r.getX(),i=n.getY()-e.getY()+r.getY(),a=1-3/s,l=Math.floor(e.getX()+a*(t-e.getX())),d=Math.floor(e.getY()+a*(i-e.getY()));for(let t=4;t<=16;t<<=1)try{c=this.findAlignmentInRegion(o,l,d,t);break}catch(t){if(!(t instanceof T))throw t}}const l=Be.createTransform(e,n,r,c,i),d=Be.sampleGrid(this.image,l,i);let u;return u=null===c?[r,e,n]:[r,e,n,c],new st(d,u)}static createTransform(t,e,n,r,o){const i=o-3.5;let a,s,c,l;return null!==r?(a=r.getX(),s=r.getY(),c=i-3,l=c):(a=e.getX()-t.getX()+n.getX(),s=e.getY()-t.getY()+n.getY(),c=i,l=i),ut.quadrilateralToQuadrilateral(3.5,3.5,i,3.5,c,l,3.5,i,t.getX(),t.getY(),e.getX(),e.getY(),a,s,n.getX(),n.getY())}static sampleGrid(t,e,n){return mt.getInstance().sampleGridWithTransform(t,n,n,e)}static computeDimension(t,e,n,r){const o=ot.round(at.distance(t,e)/r),i=ot.round(at.distance(t,n)/r);let a=Math.floor((o+i)/2)+7;switch(3&a){case 0:a++;break;case 2:a--;break;case 3:throw new T("Dimensions could be not found.")}return a}calculateModuleSize(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2}calculateModuleSizeOneWay(t,e){const n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14}sizeOfBlackWhiteBlackRunBothWays(t,e,n,r){let o=this.sizeOfBlackWhiteBlackRun(t,e,n,r),i=1,a=t-(n-t);a<0?(i=t/(t-a),a=0):a>=this.image.getWidth()&&(i=(this.image.getWidth()-1-t)/(a-t),a=this.image.getWidth()-1);let s=Math.floor(e-(r-e)*i);return i=1,s<0?(i=e/(e-s),s=0):s>=this.image.getHeight()&&(i=(this.image.getHeight()-1-e)/(s-e),s=this.image.getHeight()-1),a=Math.floor(t+(a-t)*i),o+=this.sizeOfBlackWhiteBlackRun(t,e,a,s),o-1}sizeOfBlackWhiteBlackRun(t,e,n,r){const o=Math.abs(r-e)>Math.abs(n-t);if(o){let o=t;t=e,e=o,o=n,n=r,r=o}const i=Math.abs(n-t),a=Math.abs(r-e);let s=-i/2;const c=t<n?1:-1,l=e<r?1:-1;let d=0;const u=n+c;for(let n=t,h=e;n!==u;n+=c){const c=o?h:n,u=o?n:h;if(1===d===this.image.get(c,u)){if(2===d)return ot.distance(n,h,t,e);d++}if(s+=a,s>0){if(h===r)break;h+=l,s-=i}}return 2===d?ot.distance(n+c,r,t,e):NaN}findAlignmentInRegion(t,e,n,r){const o=Math.floor(r*t),i=Math.max(0,e-o),a=Math.min(this.image.getWidth()-1,e+o);if(a-i<3*t)throw new T("Alignment top exceeds estimated module size.");const s=Math.max(0,n-o),c=Math.min(this.image.getHeight()-1,n+o);if(c-s<3*t)throw new T("Alignment bottom exceeds estimated module size.");return new xe(this.image,i,s,a-i,c-s,t,this.resultPointCallback).find()}}class Fe{constructor(){this.decoder=new Ne}getDecoder(){return this.decoder}decode(t,e){let n,r;if(null!=e&&void 0!==e.get(b.PURE_BARCODE)){const o=Fe.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(o,e),r=Fe.NO_POINTS}else{const o=new Be(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(o.getBits(),e),r=o.getPoints()}n.getOther()instanceof Re&&n.getOther().applyMirroredCorrection(r);const o=new L(n.getText(),n.getRawBytes(),void 0,r,V.QR_CODE,void 0),i=n.getByteSegments();null!==i&&o.putMetadata(X.BYTE_SEGMENTS,i);const a=n.getECLevel();return null!==a&&o.putMetadata(X.ERROR_CORRECTION_LEVEL,a),n.hasStructuredAppend()&&(o.putMetadata(X.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),o.putMetadata(X.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),o}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(null===e||null===n)throw new T;const r=this.moduleSize(e,t);let o=e[1],i=n[1],a=e[0],s=n[0];if(a>=s||o>=i)throw new T;if(i-o!==s-a&&(s=a+(i-o),s>=t.getWidth()))throw new T;const c=Math.round((s-a+1)/r),l=Math.round((i-o+1)/r);if(c<=0||l<=0)throw new T;if(l!==c)throw new T;const d=Math.floor(r/2);o+=d,a+=d;const u=a+Math.floor((c-1)*r)-s;if(u>0){if(u>d)throw new T;a-=u}const h=o+Math.floor((l-1)*r)-i;if(h>0){if(h>d)throw new T;o-=h}const m=new k(c,l);for(let e=0;e<l;e++){const n=o+Math.floor(e*r);for(let o=0;o<c;o++)t.get(a+Math.floor(o*r),n)&&m.set(o,e)}return m}static moduleSize(t,e){const n=e.getHeight(),r=e.getWidth();let o=t[0],i=t[1],a=!0,s=0;for(;o<r&&i<n;){if(a!==e.get(o,i)){if(5===++s)break;a=!a}o++,i++}if(o===r||i===n)throw new T;return(o-t[0])/7}}Fe.NO_POINTS=new Array;class Le{PDF417Common(){}static getBitCountSum(t){return ot.sum(t)}static toIntArray(t){if(null==t||!t.length)return Le.EMPTY_INT_ARRAY;const e=new Int32Array(t.length);let n=0;for(const r of t)e[n++]=r;return e}static getCodeword(t){const e=g.binarySearch(Le.SYMBOL_TABLE,262143&t);return e<0?-1:(Le.CODEWORD_TABLE[e]-1)%Le.NUMBER_OF_CODEWORDS}}Le.NUMBER_OF_CODEWORDS=929,Le.MAX_CODEWORDS_IN_BARCODE=Le.NUMBER_OF_CODEWORDS-1,Le.MIN_ROWS_IN_BARCODE=3,Le.MAX_ROWS_IN_BARCODE=90,Le.MODULES_IN_CODEWORD=17,Le.MODULES_IN_STOP_PATTERN=18,Le.BARS_IN_MODULE=8,Le.EMPTY_INT_ARRAY=new Int32Array([]),Le.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),Le.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class qe{constructor(t,e){this.bits=t,this.points=e}getBits(){return this.bits}getPoints(){return this.points}}class Ve{static detectMultiple(t,e,n){let r=t.getBlackMatrix(),o=Ve.detect(n,r);return o.length||(r=r.clone(),r.rotate180(),o=Ve.detect(n,r)),new qe(r,o)}static detect(t,e){const n=new Array;let r=0,o=0,i=!1;for(;r<e.getHeight();){const a=Ve.findVertices(e,r,o);if(null!=a[0]||null!=a[3]){if(i=!0,n.push(a),!t)break;null!=a[2]?(o=Math.trunc(a[2].getX()),r=Math.trunc(a[2].getY())):(o=Math.trunc(a[4].getX()),r=Math.trunc(a[4].getY()))}else{if(!i)break;i=!1,o=0;for(const t of n)null!=t[1]&&(r=Math.trunc(Math.max(r,t[1].getY()))),null!=t[3]&&(r=Math.max(r,Math.trunc(t[3].getY())));r+=Ve.ROW_STEP}}return n}static findVertices(t,e,n){const r=t.getHeight(),o=t.getWidth(),i=new Array(8);return Ve.copyToResult(i,Ve.findRowsWithPattern(t,r,o,e,n,Ve.START_PATTERN),Ve.INDEXES_START_PATTERN),null!=i[4]&&(n=Math.trunc(i[4].getX()),e=Math.trunc(i[4].getY())),Ve.copyToResult(i,Ve.findRowsWithPattern(t,r,o,e,n,Ve.STOP_PATTERN),Ve.INDEXES_STOP_PATTERN),i}static copyToResult(t,e,n){for(let r=0;r<n.length;r++)t[n[r]]=e[r]}static findRowsWithPattern(t,e,n,r,o,i){const a=new Array(4);let s=!1;const c=new Int32Array(i.length);for(;r<e;r+=Ve.ROW_STEP){let e=Ve.findGuardPattern(t,o,r,n,!1,i,c);if(null!=e){for(;r>0;){const a=Ve.findGuardPattern(t,o,--r,n,!1,i,c);if(null==a){r++;break}e=a}a[0]=new at(e[0],r),a[1]=new at(e[1],r),s=!0;break}}let l=r+1;if(s){let r=0,o=Int32Array.from([Math.trunc(a[0].getX()),Math.trunc(a[1].getX())]);for(;l<e;l++){const e=Ve.findGuardPattern(t,o[0],l,n,!1,i,c);if(null!=e&&Math.abs(o[0]-e[0])<Ve.MAX_PATTERN_DRIFT&&Math.abs(o[1]-e[1])<Ve.MAX_PATTERN_DRIFT)o=e,r=0;else{if(r>Ve.SKIPPED_ROW_COUNT_MAX)break;r++}}l-=r+1,a[2]=new at(o[0],l),a[3]=new at(o[1],l)}return l-r<Ve.BARCODE_MIN_HEIGHT&&g.fill(a,null),a}static findGuardPattern(t,e,n,r,o,i,a){g.fillWithin(a,0,a.length,0);let s=e,c=0;for(;t.get(s,n)&&s>0&&c++<Ve.MAX_PIXEL_DRIFT;)s--;let l=s,d=0,u=i.length;for(let e=o;l<r;l++)if(t.get(l,n)!==e)a[d]++;else{if(d===u-1){if(Ve.patternMatchVariance(a,i,Ve.MAX_INDIVIDUAL_VARIANCE)<Ve.MAX_AVG_VARIANCE)return new Int32Array([s,l]);s+=a[0]+a[1],f.arraycopy(a,2,a,0,d-1),a[d-1]=0,a[d]=0,d--}else d++;a[d]=1,e=!e}return d===u-1&&Ve.patternMatchVariance(a,i,Ve.MAX_INDIVIDUAL_VARIANCE)<Ve.MAX_AVG_VARIANCE?new Int32Array([s,l-1]):null}static patternMatchVariance(t,e,n){let r=t.length,o=0,i=0;for(let n=0;n<r;n++)o+=t[n],i+=e[n];if(o<i)return 1/0;let a=o/i;n*=a;let s=0;for(let o=0;o<r;o++){let r=t[o],i=e[o]*a,c=r>i?r-i:i-r;if(c>n)return 1/0;s+=c}return s/o}}Ve.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),Ve.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),Ve.MAX_AVG_VARIANCE=.42,Ve.MAX_INDIVIDUAL_VARIANCE=.8,Ve.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),Ve.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),Ve.MAX_PIXEL_DRIFT=3,Ve.MAX_PATTERN_DRIFT=5,Ve.SKIPPED_ROW_COUNT_MAX=25,Ve.ROW_STEP=5,Ve.BARCODE_MIN_HEIGHT=10;class He{constructor(t,e){if(0===e.length)throw new d;this.field=t;let n=e.length;if(n>1&&0===e[0]){let t=1;for(;t<n&&0===e[t];)t++;t===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-t),f.arraycopy(e,t,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(0===t)return this.getCoefficient(0);if(1===t){let t=0;for(let e of this.coefficients)t=this.field.add(t,e);return t}let e=this.coefficients[0],n=this.coefficients.length;for(let r=1;r<n;r++)e=this.field.add(this.field.multiply(t,e),this.coefficients[r]);return e}add(t){if(!this.field.equals(t.field))throw new d("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;let e=this.coefficients,n=t.coefficients;if(e.length>n.length){let t=e;e=n,n=t}let r=new Int32Array(n.length),o=n.length-e.length;f.arraycopy(n,0,r,0,o);for(let t=o;t<n.length;t++)r[t]=this.field.add(e[t-o],n[t]);return new He(this.field,r)}subtract(t){if(!this.field.equals(t.field))throw new d("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())}multiply(t){return t instanceof He?this.multiplyOther(t):this.multiplyScalar(t)}multiplyOther(t){if(!this.field.equals(t.field))throw new d("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new He(this.field,new Int32Array([0]));let e=this.coefficients,n=e.length,r=t.coefficients,o=r.length,i=new Int32Array(n+o-1);for(let t=0;t<n;t++){let n=e[t];for(let e=0;e<o;e++)i[t+e]=this.field.add(i[t+e],this.field.multiply(n,r[e]))}return new He(this.field,i)}negative(){let t=this.coefficients.length,e=new Int32Array(t);for(let n=0;n<t;n++)e[n]=this.field.subtract(0,this.coefficients[n]);return new He(this.field,e)}multiplyScalar(t){if(0===t)return new He(this.field,new Int32Array([0]));if(1===t)return this;let e=this.coefficients.length,n=new Int32Array(e);for(let r=0;r<e;r++)n[r]=this.field.multiply(this.coefficients[r],t);return new He(this.field,n)}multiplyByMonomial(t,e){if(t<0)throw new d;if(0===e)return new He(this.field,new Int32Array([0]));let n=this.coefficients.length,r=new Int32Array(n+t);for(let t=0;t<n;t++)r[t]=this.field.multiply(this.coefficients[t],e);return new He(this.field,r)}toString(){let t=new S;for(let e=this.getDegree();e>=0;e--){let n=this.getCoefficient(e);0!==n&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),0!==e&&1===n||t.append(n),0!==e&&(1===e?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()}}class Ue{add(t,e){return(t+e)%this.modulus}subtract(t,e){return(this.modulus+t-e)%this.modulus}exp(t){return this.expTable[t]}log(t){if(0===t)throw new d;return this.logTable[t]}inverse(t){if(0===t)throw new K;return this.expTable[this.modulus-this.logTable[t]-1]}multiply(t,e){return 0===t||0===e?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]}getSize(){return this.modulus}equals(t){return t===this}}class ze extends Ue{constructor(t,e){super(),this.modulus=t,this.expTable=new Int32Array(t),this.logTable=new Int32Array(t);let n=1;for(let r=0;r<t;r++)this.expTable[r]=n,n=n*e%t;for(let e=0;e<t-1;e++)this.logTable[this.expTable[e]]=e;this.zero=new He(this,new Int32Array([0])),this.one=new He(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,e){if(t<0)throw new d;if(0===e)return this.zero;let n=new Int32Array(t+1);return n[0]=e,new He(this,n)}}ze.PDF417_GF=new ze(Le.NUMBER_OF_CODEWORDS,3);class We{constructor(){this.field=ze.PDF417_GF}decode(t,e,n){let r=new He(this.field,t),o=new Int32Array(e),i=!1;for(let t=e;t>0;t--){let n=r.evaluateAt(this.field.exp(t));o[e-t]=n,0!==n&&(i=!0)}if(!i)return 0;let a=this.field.getOne();if(null!=n)for(const e of n){let n=this.field.exp(t.length-1-e),r=new He(this.field,new Int32Array([this.field.subtract(0,n),1]));a=a.multiply(r)}let s=new He(this.field,o),c=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),s,e),l=c[0],d=c[1],u=this.findErrorLocations(l),m=this.findErrorMagnitudes(d,l,u);for(let e=0;e<u.length;e++){let n=t.length-1-this.field.log(u[e]);if(n<0)throw h.getChecksumInstance();t[n]=this.field.subtract(t[n],m[e])}return u.length}runEuclideanAlgorithm(t,e,n){if(t.getDegree()<e.getDegree()){let n=t;t=e,e=n}let r=t,o=e,i=this.field.getZero(),a=this.field.getOne();for(;o.getDegree()>=Math.round(n/2);){let t=r,e=i;if(r=o,i=a,r.isZero())throw h.getChecksumInstance();o=t;let n=this.field.getZero(),s=r.getCoefficient(r.getDegree()),c=this.field.inverse(s);for(;o.getDegree()>=r.getDegree()&&!o.isZero();){let t=o.getDegree()-r.getDegree(),e=this.field.multiply(o.getCoefficient(o.getDegree()),c);n=n.add(this.field.buildMonomial(t,e)),o=o.subtract(r.multiplyByMonomial(t,e))}a=n.multiply(i).subtract(e).negative()}let s=a.getCoefficient(0);if(0===s)throw h.getChecksumInstance();let c=this.field.inverse(s);return[a.multiply(c),o.multiply(c)]}findErrorLocations(t){let e=t.getDegree(),n=new Int32Array(e),r=0;for(let o=1;o<this.field.getSize()&&r<e;o++)0===t.evaluateAt(o)&&(n[r]=this.field.inverse(o),r++);if(r!==e)throw h.getChecksumInstance();return n}findErrorMagnitudes(t,e,n){let r=e.getDegree(),o=new Int32Array(r);for(let t=1;t<=r;t++)o[r-t]=this.field.multiply(t,e.getCoefficient(t));let i=new He(this.field,o),a=n.length,s=new Int32Array(a);for(let e=0;e<a;e++){let r=this.field.inverse(n[e]),o=this.field.subtract(0,t.evaluateAt(r)),a=this.field.inverse(i.evaluateAt(r));s[e]=this.field.multiply(o,a)}return s}}class je{constructor(t,e,n,r,o){t instanceof je?this.constructor_2(t):this.constructor_1(t,e,n,r,o)}constructor_1(t,e,n,r,o){const i=null==e||null==n,a=null==r||null==o;if(i&&a)throw new T;i?(e=new at(0,r.getY()),n=new at(0,o.getY())):a&&(r=new at(t.getWidth()-1,e.getY()),o=new at(t.getWidth()-1,n.getY())),this.image=t,this.topLeft=e,this.bottomLeft=n,this.topRight=r,this.bottomRight=o,this.minX=Math.trunc(Math.min(e.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),o.getX())),this.minY=Math.trunc(Math.min(e.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),o.getY()))}constructor_2(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()}static merge(t,e){return null==t?e:null==e?t:new je(t.image,t.topLeft,t.bottomLeft,e.topRight,e.bottomRight)}addMissingRows(t,e,n){let r=this.topLeft,o=this.bottomLeft,i=this.topRight,a=this.bottomRight;if(t>0){let e=n?this.topLeft:this.topRight,o=Math.trunc(e.getY()-t);o<0&&(o=0);let a=new at(e.getX(),o);n?r=a:i=a}if(e>0){let t=n?this.bottomLeft:this.bottomRight,r=Math.trunc(t.getY()+e);r>=this.image.getHeight()&&(r=this.image.getHeight()-1);let i=new at(t.getX(),r);n?o=i:a=i}return new je(this.image,r,o,i,a)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Ge{constructor(t,e,n,r){this.columnCount=t,this.errorCorrectionLevel=r,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class Xe{constructor(){this.buffer=""}static form(t,e){let n=-1;function r(t,r,o,i,a,s){if("%%"===t)return"%";if(void 0===e[++n])return;t=i?parseInt(i.substr(1)):void 0;let c,l=a?parseInt(a.substr(1)):void 0;switch(s){case"s":c=e[n];break;case"c":c=e[n][0];break;case"f":c=parseFloat(e[n]).toFixed(t);break;case"p":c=parseFloat(e[n]).toPrecision(t);break;case"e":c=parseFloat(e[n]).toExponential(t);break;case"x":c=parseInt(e[n]).toString(l||16);break;case"d":c=parseFloat(parseInt(e[n],l||10).toPrecision(t)).toFixed(0)}c="object"==typeof c?JSON.stringify(c):(+c).toString(l);let d=parseInt(o),u=o&&o[0]+""=="0"?"0":" ";for(;c.length<d;)c=void 0!==r?c+u:u+c;return c}let o=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(o,r)}format(t,...e){this.buffer+=Xe.form(t,e)}toString(){return this.buffer}}class Qe{constructor(t){this.boundingBox=new je(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}getCodewordNearby(t){let e=this.getCodeword(t);if(null!=e)return e;for(let n=1;n<Qe.MAX_NEARBY_DISTANCE;n++){let r=this.imageRowToCodewordIndex(t)-n;if(r>=0&&(e=this.codewords[r],null!=e))return e;if(r=this.imageRowToCodewordIndex(t)+n,r<this.codewords.length&&(e=this.codewords[r],null!=e))return e}return null}imageRowToCodewordIndex(t){return t-this.boundingBox.getMinY()}setCodeword(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e}getCodeword(t){return this.codewords[this.imageRowToCodewordIndex(t)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const t=new Xe;let e=0;for(const n of this.codewords)null!=n?t.format("%3d: %3d|%3d%n",e++,n.getRowNumber(),n.getValue()):t.format("%3d: | %n",e++);return t.toString()}}Qe.MAX_NEARBY_DISTANCE=5;class Ye{constructor(){this.values=new Map}setValue(t){t=Math.trunc(t);let e=this.values.get(t);null==e&&(e=0),e++,this.values.set(t,e)}getValue(){let t=-1,e=new Array;for(const[n,r]of this.values.entries()){const o={getKey:()=>n,getValue:()=>r};o.getValue()>t?(t=o.getValue(),e=[],e.push(o.getKey())):o.getValue()===t&&e.push(o.getKey())}return Le.toIntArray(e)}getConfidence(t){return this.values.get(t)}}class Ze extends Qe{constructor(t,e){super(t),this._isLeft=e}setRowNumbers(){for(let t of this.getCodewords())null!=t&&t.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(t){let e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);let n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),o=this._isLeft?n.getBottomLeft():n.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),a=this.imageRowToCodewordIndex(Math.trunc(o.getY())),s=-1,c=1,l=0;for(let n=i;n<a;n++){if(null==e[n])continue;let r=e[n],o=r.getRowNumber()-s;if(0===o)l++;else if(1===o)c=Math.max(c,l),l=1,s=r.getRowNumber();else if(o<0||r.getRowNumber()>=t.getRowCount()||o>n)e[n]=null;else{let t;t=c>2?(c-2)*o:o;let i=t>=n;for(let r=1;r<=t&&!i;r++)i=null!=e[n-r];i?e[n]=null:(s=r.getRowNumber(),l=1)}}}getRowHeights(){let t=this.getBarcodeMetadata();if(null==t)return null;this.adjustIncompleteIndicatorColumnRowNumbers(t);let e=new Int32Array(t.getRowCount());for(let t of this.getCodewords())if(null!=t){let n=t.getRowNumber();if(n>=e.length)continue;e[n]++}return e}adjustIncompleteIndicatorColumnRowNumbers(t){let e=this.getBoundingBox(),n=this._isLeft?e.getTopLeft():e.getTopRight(),r=this._isLeft?e.getBottomLeft():e.getBottomRight(),o=this.imageRowToCodewordIndex(Math.trunc(n.getY())),i=this.imageRowToCodewordIndex(Math.trunc(r.getY())),a=this.getCodewords(),s=-1;for(let e=o;e<i;e++){if(null==a[e])continue;let n=a[e];n.setRowNumberAsRowIndicatorColumn();let r=n.getRowNumber()-s;0===r||(1===r?s=n.getRowNumber():n.getRowNumber()>=t.getRowCount()?a[e]=null:s=n.getRowNumber())}}getBarcodeMetadata(){let t=this.getCodewords(),e=new Ye,n=new Ye,r=new Ye,o=new Ye;for(let i of t){if(null==i)continue;i.setRowNumberAsRowIndicatorColumn();let t=i.getValue()%30,a=i.getRowNumber();switch(this._isLeft||(a+=2),a%3){case 0:n.setValue(3*t+1);break;case 1:o.setValue(t/3),r.setValue(t%3);break;case 2:e.setValue(t+1)}}if(0===e.getValue().length||0===n.getValue().length||0===r.getValue().length||0===o.getValue().length||e.getValue()[0]<1||n.getValue()[0]+r.getValue()[0]<Le.MIN_ROWS_IN_BARCODE||n.getValue()[0]+r.getValue()[0]>Le.MAX_ROWS_IN_BARCODE)return null;let i=new Ge(e.getValue()[0],n.getValue()[0],r.getValue()[0],o.getValue()[0]);return this.removeIncorrectCodewords(t,i),i}removeIncorrectCodewords(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(null==t[n])continue;let o=r.getValue()%30,i=r.getRowNumber();if(i>e.getRowCount())t[n]=null;else switch(this._isLeft||(i+=2),i%3){case 0:3*o+1!==e.getRowCountUpperPart()&&(t[n]=null);break;case 1:Math.trunc(o/3)===e.getErrorCorrectionLevel()&&o%3===e.getRowCountLowerPart()||(t[n]=null);break;case 2:o+1!==e.getColumnCount()&&(t[n]=null)}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+"\n"+super.toString()}}class Ke{constructor(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let t,e=Le.MAX_CODEWORDS_IN_BARCODE;do{t=e,e=this.adjustRowNumbersAndGetCount()}while(e>0&&e<t);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(t){null!=t&&t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let t=this.adjustRowNumbersByRow();if(0===t)return 0;for(let t=1;t<this.barcodeColumnCount+1;t++){let e=this.detectionResultColumns[t].getCodewords();for(let n=0;n<e.length;n++)null!=e[n]&&(e[n].hasValidRowNumber()||this.adjustRowNumbers(t,n,e))}return t}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(null==this.detectionResultColumns[0]||null==this.detectionResultColumns[this.barcodeColumnCount+1])return;let t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<t.length;n++)if(null!=t[n]&&null!=e[n]&&t[n].getRowNumber()===e[n].getRowNumber())for(let e=1;e<=this.barcodeColumnCount;e++){let r=this.detectionResultColumns[e].getCodewords()[n];null!=r&&(r.setRowNumber(t[n].getRowNumber()),r.hasValidRowNumber()||(this.detectionResultColumns[e].getCodewords()[n]=null))}}adjustRowNumbersFromRRI(){if(null==this.detectionResultColumns[this.barcodeColumnCount+1])return 0;let t=0,e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<e.length;n++){if(null==e[n])continue;let r=e[n].getRowNumber(),o=0;for(let e=this.barcodeColumnCount+1;e>0&&o<this.ADJUST_ROW_NUMBER_SKIP;e--){let i=this.detectionResultColumns[e].getCodewords()[n];null!=i&&(o=Ke.adjustRowNumberIfValid(r,o,i),i.hasValidRowNumber()||t++)}}return t}adjustRowNumbersFromLRI(){if(null==this.detectionResultColumns[0])return 0;let t=0,e=this.detectionResultColumns[0].getCodewords();for(let n=0;n<e.length;n++){if(null==e[n])continue;let r=e[n].getRowNumber(),o=0;for(let e=1;e<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;e++){let i=this.detectionResultColumns[e].getCodewords()[n];null!=i&&(o=Ke.adjustRowNumberIfValid(r,o,i),i.hasValidRowNumber()||t++)}}return t}static adjustRowNumberIfValid(t,e,n){return null==n||n.hasValidRowNumber()||(n.isValidRowNumber(t)?(n.setRowNumber(t),e=0):++e),e}adjustRowNumbers(t,e,n){if(!this.detectionResultColumns[t-1])return;let r=n[e],o=this.detectionResultColumns[t-1].getCodewords(),i=o;null!=this.detectionResultColumns[t+1]&&(i=this.detectionResultColumns[t+1].getCodewords());let a=new Array(14);a[2]=o[e],a[3]=i[e],e>0&&(a[0]=n[e-1],a[4]=o[e-1],a[5]=i[e-1]),e>1&&(a[8]=n[e-2],a[10]=o[e-2],a[11]=i[e-2]),e<n.length-1&&(a[1]=n[e+1],a[6]=o[e+1],a[7]=i[e+1]),e<n.length-2&&(a[9]=n[e+2],a[12]=o[e+2],a[13]=i[e+2]);for(let t of a)if(Ke.adjustRowNumber(r,t))return}static adjustRowNumber(t,e){return!(null==e||!e.hasValidRowNumber()||e.getBucket()!==t.getBucket()||(t.setRowNumber(e.getRowNumber()),0))}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(t){this.boundingBox=t}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(t,e){this.detectionResultColumns[t]=e}getDetectionResultColumn(t){return this.detectionResultColumns[t]}toString(){let t=this.detectionResultColumns[0];null==t&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);let e=new Xe;for(let n=0;n<t.getCodewords().length;n++){e.format("CW %3d:",n);for(let t=0;t<this.barcodeColumnCount+2;t++){if(null==this.detectionResultColumns[t]){e.format(" | ");continue}let r=this.detectionResultColumns[t].getCodewords()[n];null!=r?e.format(" %3d|%3d",r.getRowNumber(),r.getValue()):e.format(" | ")}e.format("%n")}return e.toString()}}class Je{constructor(t,e,n,r){this.rowNumber=Je.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(e),this.bucket=Math.trunc(n),this.value=Math.trunc(r)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(t){return t!==Je.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(3*Math.trunc(this.value/30)+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(t){this.rowNumber=t}toString(){return this.rowNumber+"|"+this.value}}Je.BARCODE_ROW_UNKNOWN=-1;class tn{static initialize(){for(let t=0;t<Le.SYMBOL_TABLE.length;t++){let e=Le.SYMBOL_TABLE[t],n=1&e;for(let r=0;r<Le.BARS_IN_MODULE;r++){let o=0;for(;(1&e)===n;)o+=1,e>>=1;n=1&e,tn.RATIOS_TABLE[t]||(tn.RATIOS_TABLE[t]=new Array(Le.BARS_IN_MODULE)),tn.RATIOS_TABLE[t][Le.BARS_IN_MODULE-r-1]=Math.fround(o/Le.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(t){let e=tn.getDecodedCodewordValue(tn.sampleBitCounts(t));return-1!==e?e:tn.getClosestDecodedValue(t)}static sampleBitCounts(t){let e=ot.sum(t),n=new Int32Array(Le.BARS_IN_MODULE),r=0,o=0;for(let i=0;i<Le.MODULES_IN_CODEWORD;i++){let a=e/(2*Le.MODULES_IN_CODEWORD)+i*e/Le.MODULES_IN_CODEWORD;o+t[r]<=a&&(o+=t[r],r++),n[r]++}return n}static getDecodedCodewordValue(t){let e=tn.getBitValue(t);return-1===Le.getCodeword(e)?-1:e}static getBitValue(t){let e=0;for(let n=0;n<t.length;n++)for(let r=0;r<t[n];r++)e=e<<1|(n%2==0?1:0);return Math.trunc(e)}static getClosestDecodedValue(t){let e=ot.sum(t),n=new Array(Le.BARS_IN_MODULE);if(e>1)for(let r=0;r<n.length;r++)n[r]=Math.fround(t[r]/e);let r=it.MAX_VALUE,o=-1;this.bSymbolTableReady||tn.initialize();for(let t=0;t<tn.RATIOS_TABLE.length;t++){let e=0,i=tn.RATIOS_TABLE[t];for(let t=0;t<Le.BARS_IN_MODULE;t++){let o=Math.fround(i[t]-n[t]);if(e+=Math.fround(o*o),e>=r)break}e<r&&(r=e,o=Le.SYMBOL_TABLE[t])}return o}}tn.bSymbolTableReady=!1,tn.RATIOS_TABLE=new Array(Le.SYMBOL_TABLE.length).map(t=>new Array(Le.BARS_IN_MODULE));class en{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(t){this.segmentIndex=t}getFileId(){return this.fileId}setFileId(t){this.fileId=t}getOptionalData(){return this.optionalData}setOptionalData(t){this.optionalData=t}isLastSegment(){return this.lastSegment}setLastSegment(t){this.lastSegment=t}getSegmentCount(){return this.segmentCount}setSegmentCount(t){this.segmentCount=t}getSender(){return this.sender||null}setSender(t){this.sender=t}getAddressee(){return this.addressee||null}setAddressee(t){this.addressee=t}getFileName(){return this.fileName}setFileName(t){this.fileName=t}getFileSize(){return this.fileSize}setFileSize(t){this.fileSize=t}getChecksum(){return this.checksum}setChecksum(t){this.checksum=t}getTimestamp(){return this.timestamp}setTimestamp(t){this.timestamp=t}}class nn{static parseLong(t,e=void 0){return parseInt(t,e)}}class rn extends c{}rn.kind="NullPointerException";class on{writeBytes(t){this.writeBytesOffset(t,0,t.length)}writeBytesOffset(t,e,n){if(null==t)throw new rn;if(e<0||e>t.length||n<0||e+n>t.length||e+n<0)throw new p;if(0!==n)for(let r=0;r<n;r++)this.write(t[e+r])}flush(){}close(){}}class an extends c{}class sn extends on{constructor(t=32){if(super(),this.count=0,t<0)throw new d("Negative initial size: "+t);this.buf=new Uint8Array(t)}ensureCapacity(t){t-this.buf.length>0&&this.grow(t)}grow(t){let e=this.buf.length<<1;if(e-t<0&&(e=t),e<0){if(t<0)throw new an;e=w.MAX_VALUE}this.buf=g.copyOfUint8Array(this.buf,e)}write(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1}writeBytesOffset(t,e,n){if(e<0||e>t.length||n<0||e+n-t.length>0)throw new p;this.ensureCapacity(this.count+n),f.arraycopy(t,e,this.buf,this.count,n),this.count+=n}writeTo(t){t.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return g.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(t){return t?"string"==typeof t?this.toString_string(t):this.toString_number(t):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(t){return new String(this.buf).toString()}toString_number(t){return new String(this.buf).toString()}close(){}}function cn(){if("undefined"!=typeof window)return window.BigInt||null;if(void 0!==commonjsGlobal)return commonjsGlobal.BigInt||null;if("undefined"!=typeof self)return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let ln;function dn(t){if(void 0===ln&&(ln=cn()),null===ln)throw new Error("BigInt is not supported!");return ln(t)}function un(){let t=[];t[0]=dn(1);let e=dn(900);t[1]=e;for(let n=2;n<16;n++)t[n]=t[n-1]*e;return t}!function(t){t[t.ALPHA=0]="ALPHA",t[t.LOWER=1]="LOWER",t[t.MIXED=2]="MIXED",t[t.PUNCT=3]="PUNCT",t[t.ALPHA_SHIFT=4]="ALPHA_SHIFT",t[t.PUNCT_SHIFT=5]="PUNCT_SHIFT"}(G||(G={}));class hn{static decode(t,e){let n=new S(""),r=I.ISO8859_1;n.enableDecoding(r);let o=1,i=t[o++],a=new en;for(;o<t[0];){switch(i){case hn.TEXT_COMPACTION_MODE_LATCH:o=hn.textCompaction(t,o,n);break;case hn.BYTE_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:o=hn.byteCompaction(i,t,r,o,n);break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[o++]);break;case hn.NUMERIC_COMPACTION_MODE_LATCH:o=hn.numericCompaction(t,o,n);break;case hn.ECI_CHARSET:I.getCharacterSetECIByValue(t[o++]);break;case hn.ECI_GENERAL_PURPOSE:o+=2;break;case hn.ECI_USER_DEFINED:o++;break;case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:o=hn.decodeMacroBlock(t,o,a);break;case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:throw new v;default:o--,o=hn.textCompaction(t,o,n)}if(!(o<t.length))throw v.getFormatInstance();i=t[o++]}if(0===n.length())throw v.getFormatInstance();let s=new Q(null,n.toString(),null,e);return s.setOther(a),s}static decodeMacroBlock(t,e,n){if(e+hn.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw v.getFormatInstance();let r=new Int32Array(hn.NUMBER_OF_SEQUENCE_CODEWORDS);for(let n=0;n<hn.NUMBER_OF_SEQUENCE_CODEWORDS;n++,e++)r[n]=t[e];n.setSegmentIndex(w.parseInt(hn.decodeBase900toBase10(r,hn.NUMBER_OF_SEQUENCE_CODEWORDS)));let o=new S;e=hn.textCompaction(t,e,o),n.setFileId(o.toString());let i=-1;for(t[e]===hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(i=e+1);e<t[0];)switch(t[e]){case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(t[++e]){case hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let r=new S;e=hn.textCompaction(t,e+1,r),n.setFileName(r.toString());break;case hn.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let o=new S;e=hn.textCompaction(t,e+1,o),n.setSender(o.toString());break;case hn.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let i=new S;e=hn.textCompaction(t,e+1,i),n.setAddressee(i.toString());break;case hn.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let a=new S;e=hn.numericCompaction(t,e+1,a),n.setSegmentCount(w.parseInt(a.toString()));break;case hn.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let s=new S;e=hn.numericCompaction(t,e+1,s),n.setTimestamp(nn.parseLong(s.toString()));break;case hn.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let c=new S;e=hn.numericCompaction(t,e+1,c),n.setChecksum(w.parseInt(c.toString()));break;case hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let l=new S;e=hn.numericCompaction(t,e+1,l),n.setFileSize(nn.parseLong(l.toString()));break;default:throw v.getFormatInstance()}break;case hn.MACRO_PDF417_TERMINATOR:e++,n.setLastSegment(!0);break;default:throw v.getFormatInstance()}if(-1!==i){let r=e-i;n.isLastSegment()&&r--,n.setOptionalData(g.copyOfRange(t,i,i+r))}return e}static textCompaction(t,e,n){let r=new Int32Array(2*(t[0]-e)),o=new Int32Array(2*(t[0]-e)),i=0,a=!1;for(;e<t[0]&&!a;){let n=t[e++];if(n<hn.TEXT_COMPACTION_MODE_LATCH)r[i]=n/30,r[i+1]=n%30,i+=2;else switch(n){case hn.TEXT_COMPACTION_MODE_LATCH:r[i++]=hn.TEXT_COMPACTION_MODE_LATCH;break;case hn.BYTE_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.NUMERIC_COMPACTION_MODE_LATCH:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:e--,a=!0;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r[i]=hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,n=t[e++],o[i]=n,i++}}return hn.decodeTextCompaction(r,o,i,n),e}static decodeTextCompaction(t,e,n,r){let o=G.ALPHA,i=G.ALPHA,a=0;for(;a<n;){let n=t[a],s="";switch(o){case G.ALPHA:if(n<26)s=String.fromCharCode(65+n);else switch(n){case 26:s=" ";break;case hn.LL:o=G.LOWER;break;case hn.ML:o=G.MIXED;break;case hn.PS:i=o,o=G.PUNCT_SHIFT;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.LOWER:if(n<26)s=String.fromCharCode(97+n);else switch(n){case 26:s=" ";break;case hn.AS:i=o,o=G.ALPHA_SHIFT;break;case hn.ML:o=G.MIXED;break;case hn.PS:i=o,o=G.PUNCT_SHIFT;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.MIXED:if(n<hn.PL)s=hn.MIXED_CHARS[n];else switch(n){case hn.PL:o=G.PUNCT;break;case 26:s=" ";break;case hn.LL:o=G.LOWER;break;case hn.AL:o=G.ALPHA;break;case hn.PS:i=o,o=G.PUNCT_SHIFT;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.PUNCT:if(n<hn.PAL)s=hn.PUNCT_CHARS[n];else switch(n){case hn.PAL:o=G.ALPHA;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.ALPHA_SHIFT:if(o=i,n<26)s=String.fromCharCode(65+n);else switch(n){case 26:s=" ";break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}break;case G.PUNCT_SHIFT:if(o=i,n<hn.PAL)s=hn.PUNCT_CHARS[n];else switch(n){case hn.PAL:o=G.ALPHA;break;case hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[a]);break;case hn.TEXT_COMPACTION_MODE_LATCH:o=G.ALPHA}}""!==s&&r.append(s),a++}}static byteCompaction(t,e,n,r,o){let i=new sn,a=0,s=0,c=!1;switch(t){case hn.BYTE_COMPACTION_MODE_LATCH:let t=new Int32Array(6),n=e[r++];for(;r<e[0]&&!c;)switch(t[a++]=n,s=900*s+n,n=e[r++],n){case hn.TEXT_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH:case hn.NUMERIC_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:r--,c=!0;break;default:if(a%5==0&&a>0){for(let t=0;t<6;++t)i.write(Number(dn(s)>>dn(8*(5-t))));s=0,a=0}}r===e[0]&&n<hn.TEXT_COMPACTION_MODE_LATCH&&(t[a++]=n);for(let e=0;e<a;e++)i.write(t[e]);break;case hn.BYTE_COMPACTION_MODE_LATCH_6:for(;r<e[0]&&!c;){let t=e[r++];if(t<hn.TEXT_COMPACTION_MODE_LATCH)a++,s=900*s+t;else switch(t){case hn.TEXT_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH:case hn.NUMERIC_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:r--,c=!0}if(a%5==0&&a>0){for(let t=0;t<6;++t)i.write(Number(dn(s)>>dn(8*(5-t))));s=0,a=0}}}return o.append(E.decode(i.toByteArray(),n)),r}static numericCompaction(t,e,n){let r=0,o=!1,i=new Int32Array(hn.MAX_NUMERIC_CODEWORDS);for(;e<t[0]&&!o;){let a=t[e++];if(e===t[0]&&(o=!0),a<hn.TEXT_COMPACTION_MODE_LATCH)i[r]=a,r++;else switch(a){case hn.TEXT_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH:case hn.BYTE_COMPACTION_MODE_LATCH_6:case hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case hn.MACRO_PDF417_TERMINATOR:e--,o=!0}(r%hn.MAX_NUMERIC_CODEWORDS===0||a===hn.NUMERIC_COMPACTION_MODE_LATCH||o)&&r>0&&(n.append(hn.decodeBase900toBase10(i,r)),r=0)}return e}static decodeBase900toBase10(t,e){let n=dn(0);for(let r=0;r<e;r++)n+=hn.EXP900[e-r-1]*dn(t[r]);let r=n.toString();if("1"!==r.charAt(0))throw new v;return r.substring(1)}}hn.TEXT_COMPACTION_MODE_LATCH=900,hn.BYTE_COMPACTION_MODE_LATCH=901,hn.NUMERIC_COMPACTION_MODE_LATCH=902,hn.BYTE_COMPACTION_MODE_LATCH_6=924,hn.ECI_USER_DEFINED=925,hn.ECI_GENERAL_PURPOSE=926,hn.ECI_CHARSET=927,hn.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,hn.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,hn.MACRO_PDF417_TERMINATOR=922,hn.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,hn.MAX_NUMERIC_CODEWORDS=15,hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,hn.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,hn.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,hn.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,hn.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,hn.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,hn.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,hn.PL=25,hn.LL=27,hn.AS=27,hn.ML=28,hn.AL=28,hn.PS=29,hn.PAL=29,hn.PUNCT_CHARS=";<>@[\\]_`~!\r\t,:\n-.$/\"|*()?{}'",hn.MIXED_CHARS="0123456789&\r\t,:#-.$/+%*=^",hn.EXP900=cn()?un():[],hn.NUMBER_OF_SEQUENCE_CODEWORDS=2;class mn{constructor(){}static decode(t,e,n,r,o,i,a){let s,c=new je(t,e,n,r,o),l=null,d=null;for(let n=!0;;n=!1){if(null!=e&&(l=mn.getRowIndicatorColumn(t,c,e,!0,i,a)),null!=r&&(d=mn.getRowIndicatorColumn(t,c,r,!1,i,a)),s=mn.merge(l,d),null==s)throw T.getNotFoundInstance();let o=s.getBoundingBox();if(!n||null==o||!(o.getMinY()<c.getMinY()||o.getMaxY()>c.getMaxY()))break;c=o}s.setBoundingBox(c);let u=s.getBarcodeColumnCount()+1;s.setDetectionResultColumn(0,l),s.setDetectionResultColumn(u,d);let h=null!=l;for(let e=1;e<=u;e++){let n,r=h?e:u-e;if(void 0!==s.getDetectionResultColumn(r))continue;n=0===r||r===u?new Ze(c,0===r):new Qe(c),s.setDetectionResultColumn(r,n);let o=-1,l=o;for(let e=c.getMinY();e<=c.getMaxY();e++){if(o=mn.getStartColumn(s,r,e,h),o<0||o>c.getMaxX()){if(-1===l)continue;o=l}let d=mn.detectCodeword(t,c.getMinX(),c.getMaxX(),h,o,e,i,a);null!=d&&(n.setCodeword(e,d),l=o,i=Math.min(i,d.getWidth()),a=Math.max(a,d.getWidth()))}}return mn.createDecoderResult(s)}static merge(t,e){if(null==t&&null==e)return null;let n=mn.getBarcodeMetadata(t,e);if(null==n)return null;let r=je.merge(mn.adjustBoundingBox(t),mn.adjustBoundingBox(e));return new Ke(n,r)}static adjustBoundingBox(t){if(null==t)return null;let e=t.getRowHeights();if(null==e)return null;let n=mn.getMax(e),r=0;for(let t of e)if(r+=n-t,t>0)break;let o=t.getCodewords();for(let t=0;r>0&&null==o[t];t++)r--;let i=0;for(let t=e.length-1;t>=0&&(i+=n-e[t],!(e[t]>0));t--);for(let t=o.length-1;i>0&&null==o[t];t--)i--;return t.getBoundingBox().addMissingRows(r,i,t.isLeft())}static getMax(t){let e=-1;for(let n of t)e=Math.max(e,n);return e}static getBarcodeMetadata(t,e){let n,r;return null==t||null==(n=t.getBarcodeMetadata())?null==e?null:e.getBarcodeMetadata():null==e||null==(r=e.getBarcodeMetadata())?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n}static getRowIndicatorColumn(t,e,n,r,o,i){let a=new Ze(e,r);for(let s=0;s<2;s++){let c=0===s?1:-1,l=Math.trunc(Math.trunc(n.getX()));for(let s=Math.trunc(Math.trunc(n.getY()));s<=e.getMaxY()&&s>=e.getMinY();s+=c){let e=mn.detectCodeword(t,0,t.getWidth(),r,l,s,o,i);null!=e&&(a.setCodeword(s,e),l=r?e.getStartX():e.getEndX())}}return a}static adjustCodewordCount(t,e){let n=e[0][1],r=n.getValue(),o=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-mn.getNumberOfECCodeWords(t.getBarcodeECLevel());if(0===r.length){if(o<1||o>Le.MAX_CODEWORDS_IN_BARCODE)throw T.getNotFoundInstance();n.setValue(o)}else r[0]!==o&&n.setValue(o)}static createDecoderResult(t){let e=mn.createBarcodeMatrix(t);mn.adjustCodewordCount(t,e);let n=new Array,r=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),o=[],i=new Array;for(let a=0;a<t.getBarcodeRowCount();a++)for(let s=0;s<t.getBarcodeColumnCount();s++){let c=e[a][s+1].getValue(),l=a*t.getBarcodeColumnCount()+s;0===c.length?n.push(l):1===c.length?r[l]=c[0]:(i.push(l),o.push(c))}let a=new Array(o.length);for(let t=0;t<a.length;t++)a[t]=o[t];return mn.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),r,Le.toIntArray(n),Le.toIntArray(i),a)}static createDecoderResultFromAmbiguousValues(t,e,n,r,o){let i=new Int32Array(r.length),a=100;for(;a-- >0;){for(let t=0;t<i.length;t++)e[r[t]]=o[t][i[t]];try{return mn.decodeCodewords(e,t,n)}catch(t){if(!(t instanceof h))throw t}if(0===i.length)throw h.getChecksumInstance();for(let t=0;t<i.length;t++){if(i[t]<o[t].length-1){i[t]++;break}if(i[t]=0,t===i.length-1)throw h.getChecksumInstance()}}throw h.getChecksumInstance()}static createBarcodeMatrix(t){let e=Array.from({length:t.getBarcodeRowCount()},()=>new Array(t.getBarcodeColumnCount()+2));for(let t=0;t<e.length;t++)for(let n=0;n<e[t].length;n++)e[t][n]=new Ye;let n=0;for(let r of t.getDetectionResultColumns()){if(null!=r)for(let t of r.getCodewords())if(null!=t){let r=t.getRowNumber();if(r>=0){if(r>=e.length)continue;e[r][n].setValue(t.getValue())}}n++}return e}static isValidBarcodeColumn(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1}static getStartColumn(t,e,n,r){let o=r?1:-1,i=null;if(mn.isValidBarcodeColumn(t,e-o)&&(i=t.getDetectionResultColumn(e-o).getCodeword(n)),null!=i)return r?i.getEndX():i.getStartX();if(i=t.getDetectionResultColumn(e).getCodewordNearby(n),null!=i)return r?i.getStartX():i.getEndX();if(mn.isValidBarcodeColumn(t,e-o)&&(i=t.getDetectionResultColumn(e-o).getCodewordNearby(n)),null!=i)return r?i.getEndX():i.getStartX();let a=0;for(;mn.isValidBarcodeColumn(t,e-o);){e-=o;for(let n of t.getDetectionResultColumn(e).getCodewords())if(null!=n)return(r?n.getEndX():n.getStartX())+o*a*(n.getEndX()-n.getStartX());a++}return r?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()}static detectCodeword(t,e,n,r,o,i,a,s){o=mn.adjustCodewordStartColumn(t,e,n,r,o,i);let c,l=mn.getModuleBitCount(t,e,n,r,o,i);if(null==l)return null;let d=ot.sum(l);if(r)c=o+d;else{for(let t=0;t<l.length/2;t++){let e=l[t];l[t]=l[l.length-1-t],l[l.length-1-t]=e}c=o,o=c-d}if(!mn.checkCodewordSkew(d,a,s))return null;let u=tn.getDecodedValue(l),h=Le.getCodeword(u);return-1===h?null:new Je(o,c,mn.getCodewordBucketNumber(u),h)}static getModuleBitCount(t,e,n,r,o,i){let a=o,s=new Int32Array(8),c=0,l=r?1:-1,d=r;for(;(r?a<n:a>=e)&&c<s.length;)t.get(a,i)===d?(s[c]++,a+=l):(c++,d=!d);return c===s.length||a===(r?n:e)&&c===s.length-1?s:null}static getNumberOfECCodeWords(t){return 2<<t}static adjustCodewordStartColumn(t,e,n,r,o,i){let a=o,s=r?-1:1;for(let c=0;c<2;c++){for(;(r?a>=e:a<n)&&r===t.get(a,i);){if(Math.abs(o-a)>mn.CODEWORD_SKEW_SIZE)return o;a+=s}s=-s,r=!r}return a}static checkCodewordSkew(t,e,n){return e-mn.CODEWORD_SKEW_SIZE<=t&&t<=n+mn.CODEWORD_SKEW_SIZE}static decodeCodewords(t,e,n){if(0===t.length)throw v.getFormatInstance();let r=1<<e+1,o=mn.correctErrors(t,n,r);mn.verifyCodewordCount(t,r);let i=hn.decode(t,""+e);return i.setErrorsCorrected(o),i.setErasures(n.length),i}static correctErrors(t,e,n){if(null!=e&&e.length>n/2+mn.MAX_ERRORS||n<0||n>mn.MAX_EC_CODEWORDS)throw h.getChecksumInstance();return mn.errorCorrection.decode(t,n,e)}static verifyCodewordCount(t,e){if(t.length<4)throw v.getFormatInstance();let n=t[0];if(n>t.length)throw v.getFormatInstance();if(0===n){if(!(e<t.length))throw v.getFormatInstance();t[0]=t.length-e}}static getBitCountForCodeword(t){let e=new Int32Array(8),n=0,r=e.length-1;for(;!((1&t)!==n&&(n=1&t,r--,r<0));)e[r]++,t>>=1;return e}static getCodewordBucketNumber(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)}static getCodewordBucketNumber_number(t){return mn.getCodewordBucketNumber(mn.getBitCountForCodeword(t))}static getCodewordBucketNumber_Int32Array(t){return(t[0]-t[2]+t[4]-t[6]+9)%9}static toString(t){let e=new Xe;for(let n=0;n<t.length;n++){e.format("Row %2d: ",n);for(let r=0;r<t[n].length;r++){let o=t[n][r];0===o.getValue().length?e.format(" ",null):e.format("%4d(%2d)",o.getValue()[0],o.getConfidence(o.getValue()[0]))}e.format("%n")}return e.toString()}}mn.CODEWORD_SKEW_SIZE=2,mn.MAX_ERRORS=3,mn.MAX_EC_CODEWORDS=512,mn.errorCorrection=new We;class fn{decode(t,e=null){let n=fn.decode(t,e,!1);if(null==n||0===n.length||null==n[0])throw T.getNotFoundInstance();return n[0]}decodeMultiple(t,e=null){try{return fn.decode(t,e,!0)}catch(t){if(t instanceof v||t instanceof h)throw T.getNotFoundInstance();throw t}}static decode(t,e,n){const r=new Array,o=Ve.detectMultiple(t,e,n);for(const t of o.getPoints()){const e=mn.decode(o.getBits(),t[4],t[5],t[6],t[7],fn.getMinCodewordWidth(t),fn.getMaxCodewordWidth(t)),n=new L(e.getText(),e.getRawBytes(),void 0,t,V.PDF_417);n.putMetadata(X.ERROR_CORRECTION_LEVEL,e.getECLevel());const i=e.getOther();null!=i&&n.putMetadata(X.PDF417_EXTRA_METADATA,i),r.push(n)}return r.map(t=>t)}static getMaxWidth(t,e){return null==t||null==e?0:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMinWidth(t,e){return null==t||null==e?w.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMaxCodewordWidth(t){return Math.floor(Math.max(Math.max(fn.getMaxWidth(t[0],t[4]),fn.getMaxWidth(t[6],t[2])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN),Math.max(fn.getMaxWidth(t[1],t[5]),fn.getMaxWidth(t[7],t[3])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(t){return Math.floor(Math.min(Math.min(fn.getMinWidth(t[0],t[4]),fn.getMinWidth(t[6],t[2])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN),Math.min(fn.getMinWidth(t[1],t[5]),fn.getMinWidth(t[7],t[3])*Le.MODULES_IN_CODEWORD/Le.MODULES_IN_STOP_PATTERN)))}reset(){}}class pn extends c{}pn.kind="ReaderException";class _n{constructor(t,e){this.verbose=!0===t,e&&this.setHints(e)}decode(t,e){return e&&this.setHints(e),this.decodeInternal(t)}decodeWithState(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)}setHints(t){this.hints=t;const n=!e(t)&&!0===t.get(b.TRY_HARDER),r=e(t)?null:t.get(b.POSSIBLE_FORMATS),o=new Array;if(!e(r)){const e=r.some(t=>t===V.UPC_A||t===V.UPC_E||t===V.EAN_13||t===V.EAN_8||t===V.CODABAR||t===V.CODE_39||t===V.CODE_93||t===V.CODE_128||t===V.ITF||t===V.RSS_14||t===V.RSS_EXPANDED);e&&!n&&o.push(new se(t,this.verbose)),r.includes(V.QR_CODE)&&o.push(new Fe),r.includes(V.DATA_MATRIX)&&o.push(new we),r.includes(V.AZTEC)&&o.push(new _t),r.includes(V.PDF_417)&&o.push(new fn),e&&n&&o.push(new se(t,this.verbose))}0===o.length&&(n||o.push(new se(t,this.verbose)),o.push(new Fe),o.push(new we),o.push(new _t),o.push(new fn),n&&o.push(new se(t,this.verbose))),this.readers=o}reset(){if(null!==this.readers)for(const t of this.readers)t.reset()}decodeInternal(t){if(null===this.readers)throw new pn("No readers where selected, nothing can be read.");for(const e of this.readers)try{return e.decode(t,this.hints)}catch(t){if(t instanceof pn)continue}throw new T("No MultiFormat Readers were able to detect the code.")}}class gn extends F{constructor(t=null,e=500){const n=new _n;n.setHints(t),super(n,e)}decodeBitmap(t){return this.reader.decodeWithState(t)}}class wn extends F{constructor(t=500){super(new fn,t)}}class $n extends F{constructor(t=500){super(new Fe,t)}}var yn;!function(t){t[t.ERROR_CORRECTION=0]="ERROR_CORRECTION",t[t.CHARACTER_SET=1]="CHARACTER_SET",t[t.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",t[t.MIN_SIZE=3]="MIN_SIZE",t[t.MAX_SIZE=4]="MAX_SIZE",t[t.MARGIN=5]="MARGIN",t[t.PDF417_COMPACT=6]="PDF417_COMPACT",t[t.PDF417_COMPACTION=7]="PDF417_COMPACTION",t[t.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",t[t.AZTEC_LAYERS=9]="AZTEC_LAYERS",t[t.QR_VERSION=10]="QR_VERSION"}(yn||(yn={}));var bn=yn;class vn{constructor(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new Z(t,Int32Array.from([1])))}buildGenerator(t){const e=this.cachedGenerators;if(t>=e.length){let n=e[e.length-1];const r=this.field;for(let o=e.length;o<=t;o++){const t=n.multiply(new Z(r,Int32Array.from([1,r.exp(o-1+r.getGeneratorBase())])));e.push(t),n=t}}return e[t]}encode(t,e){if(0===e)throw new d("No error correction bytes");const n=t.length-e;if(n<=0)throw new d("No data bytes provided");const r=this.buildGenerator(e),o=new Int32Array(n);f.arraycopy(t,0,o,0,n);let i=new Z(this.field,o);i=i.multiplyByMonomial(e,1);const a=i.divide(r)[1].getCoefficients(),s=e-a.length;for(let e=0;e<s;e++)t[n+e]=0;f.arraycopy(a,0,t,n+s,a.length)}}class In{constructor(){}static applyMaskPenaltyRule1(t){return In.applyMaskPenaltyRule1Internal(t,!0)+In.applyMaskPenaltyRule1Internal(t,!1)}static applyMaskPenaltyRule2(t){let e=0;const n=t.getArray(),r=t.getWidth(),o=t.getHeight();for(let t=0;t<o-1;t++){const o=n[t];for(let i=0;i<r-1;i++){const r=o[i];r===o[i+1]&&r===n[t+1][i]&&r===n[t+1][i+1]&&e++}}return In.N2*e}static applyMaskPenaltyRule3(t){let e=0;const n=t.getArray(),r=t.getWidth(),o=t.getHeight();for(let t=0;t<o;t++)for(let i=0;i<r;i++){const a=n[t];i+6<r&&1===a[i]&&0===a[i+1]&&1===a[i+2]&&1===a[i+3]&&1===a[i+4]&&0===a[i+5]&&1===a[i+6]&&(In.isWhiteHorizontal(a,i-4,i)||In.isWhiteHorizontal(a,i+7,i+11))&&e++,t+6<o&&1===n[t][i]&&0===n[t+1][i]&&1===n[t+2][i]&&1===n[t+3][i]&&1===n[t+4][i]&&0===n[t+5][i]&&1===n[t+6][i]&&(In.isWhiteVertical(n,i,t-4,t)||In.isWhiteVertical(n,i,t+7,t+11))&&e++}return e*In.N3}static isWhiteHorizontal(t,e,n){e=Math.max(e,0),n=Math.min(n,t.length);for(let r=e;r<n;r++)if(1===t[r])return!1;return!0}static isWhiteVertical(t,e,n,r){n=Math.max(n,0),r=Math.min(r,t.length);for(let o=n;o<r;o++)if(1===t[o][e])return!1;return!0}static applyMaskPenaltyRule4(t){let e=0;const n=t.getArray(),r=t.getWidth(),o=t.getHeight();for(let t=0;t<o;t++){const o=n[t];for(let t=0;t<r;t++)1===o[t]&&e++}const i=t.getHeight()*t.getWidth();return Math.floor(10*Math.abs(2*e-i)/i)*In.N4}static getDataMaskBit(t,e,n){let r,o;switch(t){case 0:r=n+e&1;break;case 1:r=1&n;break;case 2:r=e%3;break;case 3:r=(n+e)%3;break;case 4:r=Math.floor(n/2)+Math.floor(e/3)&1;break;case 5:o=n*e,r=(1&o)+o%3;break;case 6:o=n*e,r=(1&o)+o%3&1;break;case 7:o=n*e,r=o%3+(n+e&1)&1;break;default:throw new d("Invalid mask pattern: "+t)}return 0===r}static applyMaskPenaltyRule1Internal(t,e){let n=0;const r=e?t.getHeight():t.getWidth(),o=e?t.getWidth():t.getHeight(),i=t.getArray();for(let t=0;t<r;t++){let r=0,a=-1;for(let s=0;s<o;s++){const o=e?i[t][s]:i[s][t];o===a?r++:(r>=5&&(n+=In.N1+(r-5)),r=1,a=o)}r>=5&&(n+=In.N1+(r-5))}return n}}In.N1=3,In.N2=3,In.N3=40,In.N4=10;class Cn{constructor(t,e){this.width=t,this.height=e;const n=new Array(e);for(let r=0;r!==e;r++)n[r]=new Uint8Array(t);this.bytes=n}getHeight(){return this.height}getWidth(){return this.width}get(t,e){return this.bytes[e][t]}getArray(){return this.bytes}setNumber(t,e,n){this.bytes[e][t]=n}setBoolean(t,e,n){this.bytes[e][t]=n?1:0}clear(t){for(const e of this.bytes)g.fill(e,t)}equals(t){if(!(t instanceof Cn))return!1;const e=t;if(this.width!==e.width)return!1;if(this.height!==e.height)return!1;for(let t=0,n=this.height;t<n;++t){const n=this.bytes[t],r=e.bytes[t];for(let t=0,e=this.width;t<e;++t)if(n[t]!==r[t])return!1}return!0}toString(){const t=new S;for(let e=0,n=this.height;e<n;++e){const n=this.bytes[e];for(let e=0,r=this.width;e<r;++e)switch(n[e]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append(" ")}t.append("\n")}return t.toString()}}class En{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const t=new S;return t.append("<<\n"),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append("\n ecLevel: "),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append("\n version: "),t.append(this.version?this.version.toString():"null"),t.append("\n maskPattern: "),t.append(this.maskPattern.toString()),this.matrix?(t.append("\n matrix:\n"),t.append(this.matrix.toString())):t.append("\n matrix: null\n"),t.append(">>\n"),t.toString()}setMode(t){this.mode=t}setECLevel(t){this.ecLevel=t}setVersion(t){this.version=t}setMaskPattern(t){this.maskPattern=t}setMatrix(t){this.matrix=t}static isValidMaskPattern(t){return t>=0&&t<En.NUM_MASK_PATTERNS}}En.NUM_MASK_PATTERNS=8;class An extends c{}An.kind="WriterException";class Sn{constructor(){}static clearMatrix(t){t.clear(255)}static buildMatrix(t,e,n,r,o){Sn.clearMatrix(o),Sn.embedBasicPatterns(n,o),Sn.embedTypeInfo(e,r,o),Sn.maybeEmbedVersionInfo(n,o),Sn.embedDataBits(t,r,o)}static embedBasicPatterns(t,e){Sn.embedPositionDetectionPatternsAndSeparators(e),Sn.embedDarkDotAtLeftBottomCorner(e),Sn.maybeEmbedPositionAdjustmentPatterns(t,e),Sn.embedTimingPatterns(e)}static embedTypeInfo(t,e,n){const r=new $;Sn.makeTypeInfoBits(t,e,r);for(let t=0,e=r.getSize();t<e;++t){const e=r.get(r.getSize()-1-t),o=Sn.TYPE_INFO_COORDINATES[t],i=o[0],a=o[1];if(n.setBoolean(i,a,e),t<8){const r=n.getWidth()-t-1,o=8;n.setBoolean(r,o,e)}else{const r=8,o=n.getHeight()-7+(t-8);n.setBoolean(r,o,e)}}}static maybeEmbedVersionInfo(t,e){if(t.getVersionNumber()<7)return;const n=new $;Sn.makeVersionInfoBits(t,n);let r=17;for(let t=0;t<6;++t)for(let o=0;o<3;++o){const i=n.get(r);r--,e.setBoolean(t,e.getHeight()-11+o,i),e.setBoolean(e.getHeight()-11+o,t,i)}}static embedDataBits(t,e,n){let r=0,o=-1,i=n.getWidth()-1,a=n.getHeight()-1;for(;i>0;){for(6===i&&(i-=1);a>=0&&a<n.getHeight();){for(let o=0;o<2;++o){const s=i-o;if(!Sn.isEmpty(n.get(s,a)))continue;let c;r<t.getSize()?(c=t.get(r),++r):c=!1,255!==e&&In.getDataMaskBit(e,s,a)&&(c=!c),n.setBoolean(s,a,c)}a+=o}o=-o,a+=o,i-=2}if(r!==t.getSize())throw new An("Not all bits consumed: "+r+"/"+t.getSize())}static findMSBSet(t){return 32-w.numberOfLeadingZeros(t)}static calculateBCHCode(t,e){if(0===e)throw new d("0 polynomial");const n=Sn.findMSBSet(e);for(t<<=n-1;Sn.findMSBSet(t)>=n;)t^=e<<Sn.findMSBSet(t)-n;return t}static makeTypeInfoBits(t,e,n){if(!En.isValidMaskPattern(e))throw new An("Invalid mask pattern");const r=t.getBits()<<3|e;n.appendBits(r,5);const o=Sn.calculateBCHCode(r,Sn.TYPE_INFO_POLY);n.appendBits(o,10);const i=new $;if(i.appendBits(Sn.TYPE_INFO_MASK_PATTERN,15),n.xor(i),15!==n.getSize())throw new An("should not happen but we got: "+n.getSize())}static makeVersionInfoBits(t,e){e.appendBits(t.getVersionNumber(),6);const n=Sn.calculateBCHCode(t.getVersionNumber(),Sn.VERSION_INFO_POLY);if(e.appendBits(n,12),18!==e.getSize())throw new An("should not happen but we got: "+e.getSize())}static isEmpty(t){return 255===t}static embedTimingPatterns(t){for(let e=8;e<t.getWidth()-8;++e){const n=(e+1)%2;Sn.isEmpty(t.get(e,6))&&t.setNumber(e,6,n),Sn.isEmpty(t.get(6,e))&&t.setNumber(6,e,n)}}static embedDarkDotAtLeftBottomCorner(t){if(0===t.get(8,t.getHeight()-8))throw new An;t.setNumber(8,t.getHeight()-8,1)}static embedHorizontalSeparationPattern(t,e,n){for(let r=0;r<8;++r){if(!Sn.isEmpty(n.get(t+r,e)))throw new An;n.setNumber(t+r,e,0)}}static embedVerticalSeparationPattern(t,e,n){for(let r=0;r<7;++r){if(!Sn.isEmpty(n.get(t,e+r)))throw new An;n.setNumber(t,e+r,0)}}static embedPositionAdjustmentPattern(t,e,n){for(let r=0;r<5;++r){const o=Sn.POSITION_ADJUSTMENT_PATTERN[r];for(let i=0;i<5;++i)n.setNumber(t+i,e+r,o[i])}}static embedPositionDetectionPattern(t,e,n){for(let r=0;r<7;++r){const o=Sn.POSITION_DETECTION_PATTERN[r];for(let i=0;i<7;++i)n.setNumber(t+i,e+r,o[i])}}static embedPositionDetectionPatternsAndSeparators(t){const e=Sn.POSITION_DETECTION_PATTERN[0].length;Sn.embedPositionDetectionPattern(0,0,t),Sn.embedPositionDetectionPattern(t.getWidth()-e,0,t),Sn.embedPositionDetectionPattern(0,t.getWidth()-e,t);const n=8;Sn.embedHorizontalSeparationPattern(0,n-1,t),Sn.embedHorizontalSeparationPattern(t.getWidth()-n,n-1,t),Sn.embedHorizontalSeparationPattern(0,t.getWidth()-n,t);const r=7;Sn.embedVerticalSeparationPattern(r,0,t),Sn.embedVerticalSeparationPattern(t.getHeight()-r-1,0,t),Sn.embedVerticalSeparationPattern(r,t.getHeight()-r,t)}static maybeEmbedPositionAdjustmentPatterns(t,e){if(t.getVersionNumber()<2)return;const n=t.getVersionNumber()-1,r=Sn.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(let t=0,n=r.length;t!==n;t++){const o=r[t];if(o>=0)for(let t=0;t!==n;t++){const n=r[t];n>=0&&Sn.isEmpty(e.get(n,o))&&Sn.embedPositionAdjustmentPattern(n-2,o-2,e)}}}}Sn.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Sn.POSITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Sn.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Sn.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Sn.VERSION_INFO_POLY=7973,Sn.TYPE_INFO_POLY=1335,Sn.TYPE_INFO_MASK_PATTERN=21522;class kn{constructor(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Tn{constructor(){}static calculateMaskPenalty(t){return In.applyMaskPenaltyRule1(t)+In.applyMaskPenaltyRule2(t)+In.applyMaskPenaltyRule3(t)+In.applyMaskPenaltyRule4(t)}static encode(t,e,n=null){let r=Tn.DEFAULT_BYTE_MODE_ENCODING;const o=null!==n&&void 0!==n.get(bn.CHARACTER_SET);o&&(r=n.get(bn.CHARACTER_SET).toString());const i=this.chooseMode(t,r),a=new $;if(i===ke.BYTE&&(o||Tn.DEFAULT_BYTE_MODE_ENCODING!==r)){const t=I.getCharacterSetECIByName(r);void 0!==t&&this.appendECI(t,a)}this.appendModeInfo(i,a);const s=new $;let c;if(this.appendBytes(t,i,s,r),null!==n&&void 0!==n.get(bn.QR_VERSION)){const t=Number.parseInt(n.get(bn.QR_VERSION).toString(),10);c=Ce.getVersionForNumber(t);const r=this.calculateBitsNeeded(i,a,s,c);if(!this.willFit(r,c,e))throw new An("Data too big for requested version")}else c=this.recommendVersion(e,i,a,s);const l=new $;l.appendBitArray(a);const d=i===ke.BYTE?s.getSizeInBytes():t.length;this.appendLengthInfo(d,c,i,l),l.appendBitArray(s);const u=c.getECBlocksForLevel(e),h=c.getTotalCodewords()-u.getTotalECCodewords();this.terminateBits(h,l);const m=this.interleaveWithECBytes(l,c.getTotalCodewords(),h,u.getNumBlocks()),f=new En;f.setECLevel(e),f.setMode(i),f.setVersion(c);const p=c.getDimensionForVersion(),_=new Cn(p,p),g=this.chooseMaskPattern(m,e,c,_);return f.setMaskPattern(g),Sn.buildMatrix(m,e,c,g,_),f.setMatrix(_),f}static recommendVersion(t,e,n,r){const o=this.calculateBitsNeeded(e,n,r,Ce.getVersionForNumber(1)),i=this.chooseVersion(o,t),a=this.calculateBitsNeeded(e,n,r,i);return this.chooseVersion(a,t)}static calculateBitsNeeded(t,e,n,r){return e.getSize()+t.getCharacterCountBits(r)+n.getSize()}static getAlphanumericCode(t){return t<Tn.ALPHANUMERIC_TABLE.length?Tn.ALPHANUMERIC_TABLE[t]:-1}static chooseMode(t,e=null){if(I.SJIS.getName()===e&&this.isOnlyDoubleByteKanji(t))return ke.KANJI;let n=!1,r=!1;for(let e=0,o=t.length;e<o;++e){const o=t.charAt(e);if(Tn.isDigit(o))n=!0;else{if(-1===this.getAlphanumericCode(o.charCodeAt(0)))return ke.BYTE;r=!0}}return r?ke.ALPHANUMERIC:n?ke.NUMERIC:ke.BYTE}static isOnlyDoubleByteKanji(t){let e;try{e=E.encode(t,I.SJIS)}catch(t){return!1}const n=e.length;if(n%2!=0)return!1;for(let t=0;t<n;t+=2){const n=255&e[t];if((n<129||n>159)&&(n<224||n>235))return!1}return!0}static chooseMaskPattern(t,e,n,r){let o=Number.MAX_SAFE_INTEGER,i=-1;for(let a=0;a<En.NUM_MASK_PATTERNS;a++){Sn.buildMatrix(t,e,n,a,r);let s=this.calculateMaskPenalty(r);s<o&&(o=s,i=a)}return i}static chooseVersion(t,e){for(let n=1;n<=40;n++){const r=Ce.getVersionForNumber(n);if(Tn.willFit(t,r,e))return r}throw new An("Data too big")}static willFit(t,e,n){return e.getTotalCodewords()-e.getECBlocksForLevel(n).getTotalECCodewords()>=(t+7)/8}static terminateBits(t,e){const n=8*t;if(e.getSize()>n)throw new An("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(let t=0;t<4&&e.getSize()<n;++t)e.appendBit(!1);const r=7&e.getSize();if(r>0)for(let t=r;t<8;t++)e.appendBit(!1);const o=t-e.getSizeInBytes();for(let t=0;t<o;++t)e.appendBits(1&t?17:236,8);if(e.getSize()!==n)throw new An("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(t,e,n,r,o,i){if(r>=n)throw new An("Block ID too large");const a=t%n,s=n-a,c=Math.floor(t/n),l=c+1,d=Math.floor(e/n),u=d+1,h=c-d,m=l-u;if(h!==m)throw new An("EC bytes mismatch");if(n!==s+a)throw new An("RS blocks mismatch");if(t!==(d+h)*s+(u+m)*a)throw new An("Total bytes mismatch");r<s?(o[0]=d,i[0]=h):(o[0]=u,i[0]=m)}static interleaveWithECBytes(t,e,n,r){if(t.getSizeInBytes()!==n)throw new An("Number of bits and data bytes does not match");let o=0,i=0,a=0;const s=new Array;for(let c=0;c<r;++c){const l=new Int32Array(1),d=new Int32Array(1);Tn.getNumDataBytesAndNumECBytesForBlockID(e,n,r,c,l,d);const u=l[0],h=new Uint8Array(u);t.toBytes(8*o,h,0,u);const m=Tn.generateECBytes(h,d[0]);s.push(new kn(h,m)),i=Math.max(i,u),a=Math.max(a,m.length),o+=l[0]}if(n!==o)throw new An("Data bytes does not match offset");const c=new $;for(let t=0;t<i;++t)for(const e of s){const n=e.getDataBytes();t<n.length&&c.appendBits(n[t],8)}for(let t=0;t<a;++t)for(const e of s){const n=e.getErrorCorrectionBytes();t<n.length&&c.appendBits(n[t],8)}if(e!==c.getSizeInBytes())throw new An("Interleaving error: "+e+" and "+c.getSizeInBytes()+" differ.");return c}static generateECBytes(t,e){const n=t.length,r=new Int32Array(n+e);for(let e=0;e<n;e++)r[e]=255&t[e];new vn(J.QR_CODE_FIELD_256).encode(r,e);const o=new Uint8Array(e);for(let t=0;t<e;t++)o[t]=r[n+t];return o}static appendModeInfo(t,e){e.appendBits(t.getBits(),4)}static appendLengthInfo(t,e,n,r){const o=n.getCharacterCountBits(e);if(t>=1<<o)throw new An(t+" is bigger than "+((1<<o)-1));r.appendBits(t,o)}static appendBytes(t,e,n,r){switch(e){case ke.NUMERIC:Tn.appendNumericBytes(t,n);break;case ke.ALPHANUMERIC:Tn.appendAlphanumericBytes(t,n);break;case ke.BYTE:Tn.append8BitBytes(t,n,r);break;case ke.KANJI:Tn.appendKanjiBytes(t,n);break;default:throw new An("Invalid mode: "+e)}}static getDigit(t){return t.charCodeAt(0)-48}static isDigit(t){const e=Tn.getDigit(t);return e>=0&&e<=9}static appendNumericBytes(t,e){const n=t.length;let r=0;for(;r<n;){const o=Tn.getDigit(t.charAt(r));if(r+2<n){const n=Tn.getDigit(t.charAt(r+1)),i=Tn.getDigit(t.charAt(r+2));e.appendBits(100*o+10*n+i,10),r+=3}else if(r+1<n){const n=Tn.getDigit(t.charAt(r+1));e.appendBits(10*o+n,7),r+=2}else e.appendBits(o,4),r++}}static appendAlphanumericBytes(t,e){const n=t.length;let r=0;for(;r<n;){const o=Tn.getAlphanumericCode(t.charCodeAt(r));if(-1===o)throw new An;if(r+1<n){const n=Tn.getAlphanumericCode(t.charCodeAt(r+1));if(-1===n)throw new An;e.appendBits(45*o+n,11),r+=2}else e.appendBits(o,6),r++}}static append8BitBytes(t,e,n){let r;try{r=E.encode(t,n)}catch(t){throw new An(t)}for(let t=0,n=r.length;t!==n;t++){const n=r[t];e.appendBits(n,8)}}static appendKanjiBytes(t,e){let n;try{n=E.encode(t,I.SJIS)}catch(t){throw new An(t)}const r=n.length;for(let t=0;t<r;t+=2){const r=(255&n[t])<<8&4294967295|255&n[t+1];let o=-1;if(r>=33088&&r<=40956?o=r-33088:r>=57408&&r<=60351&&(o=r-49472),-1===o)throw new An("Invalid byte sequence");const i=192*(o>>8)+(255&o);e.appendBits(i,13)}}static appendECI(t,e){e.appendBits(ke.ECI.getBits(),4),e.appendBits(t.getValue(),8)}}Tn.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),Tn.DEFAULT_BYTE_MODE_ENCODING=I.UTF8.getName();class Rn{write(t,e,n,r=null){if(0===t.length)throw new d("Found empty contents");if(e<0||n<0)throw new d("Requested dimensions are too small: "+e+"x"+n);let o=ye.L,i=Rn.QUIET_ZONE_SIZE;null!==r&&(void 0!==r.get(bn.ERROR_CORRECTION)&&(o=ye.fromString(r.get(bn.ERROR_CORRECTION).toString())),void 0!==r.get(bn.MARGIN)&&(i=Number.parseInt(r.get(bn.MARGIN).toString(),10)));const a=Tn.encode(t,o,r);return this.renderResult(a,e,n,i)}writeToDom(t,e,n,r,o=null){"string"==typeof t&&(t=document.querySelector(t));const i=this.write(e,n,r,o);t&&t.appendChild(i)}renderResult(t,e,n,r){const o=t.getMatrix();if(null===o)throw new et;const i=o.getWidth(),a=o.getHeight(),s=i+2*r,c=a+2*r,l=Math.max(e,s),d=Math.max(n,c),u=Math.min(Math.floor(l/s),Math.floor(d/c)),h=Math.floor((l-i*u)/2),m=Math.floor((d-a*u)/2),f=this.createSVGElement(l,d);for(let t=0,e=m;t<a;t++,e+=u)for(let n=0,r=h;n<i;n++,r+=u)if(1===o.get(n,t)){const t=this.createSvgRectElement(r,e,u,u);f.appendChild(t)}return f}createSVGElement(t,e){const n=document.createElementNS(Rn.SVG_NS,"svg");return n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString()),n}createSvgRectElement(t,e,n,r){const o=document.createElementNS(Rn.SVG_NS,"rect");return o.setAttributeNS(null,"x",t.toString()),o.setAttributeNS(null,"y",e.toString()),o.setAttributeNS(null,"height",n.toString()),o.setAttributeNS(null,"width",r.toString()),o.setAttributeNS(null,"fill","#000000"),o}}Rn.QUIET_ZONE_SIZE=4,Rn.SVG_NS="http://www.w3.org/2000/svg";class Nn{encode(t,e,n,r,o){if(0===t.length)throw new d("Found empty contents");if(e!==V.QR_CODE)throw new d("Can only encode QR_CODE, but got "+e);if(n<0||r<0)throw new d(`Requested dimensions are too small: ${n}x${r}`);let i=ye.L,a=Nn.QUIET_ZONE_SIZE;null!==o&&(void 0!==o.get(bn.ERROR_CORRECTION)&&(i=ye.fromString(o.get(bn.ERROR_CORRECTION).toString())),void 0!==o.get(bn.MARGIN)&&(a=Number.parseInt(o.get(bn.MARGIN).toString(),10)));const s=Tn.encode(t,i,o);return Nn.renderResult(s,n,r,a)}static renderResult(t,e,n,r){const o=t.getMatrix();if(null===o)throw new et;const i=o.getWidth(),a=o.getHeight(),s=i+2*r,c=a+2*r,l=Math.max(e,s),d=Math.max(n,c),u=Math.min(Math.floor(l/s),Math.floor(d/c)),h=Math.floor((l-i*u)/2),m=Math.floor((d-a*u)/2),f=new k(l,d);for(let t=0,e=m;t<a;t++,e+=u)for(let n=0,r=h;n<i;n++,r+=u)1===o.get(n,t)&&f.setRegion(r,e,u,u);return f}}Nn.QUIET_ZONE_SIZE=4;class Dn{encode(t,e,n,r,o){let i;if(e!==V.QR_CODE)throw new d("No encoder available for format "+e);return i=new Nn,i.encode(t,e,n,r,o)}}class xn extends D{constructor(t,e,n,r,o,i,a,s){if(super(i,a),this.yuvData=t,this.dataWidth=e,this.dataHeight=n,this.left=r,this.top=o,r+i>e||o+a>n)throw new d("Crop rectangle does not fit within image data.");s&&this.reverseHorizontal(i,a)}getRow(t,e){if(t<0||t>=this.getHeight())throw new d("Requested row is outside the image: "+t);const n=this.getWidth();(null==e||e.length<n)&&(e=new Uint8ClampedArray(n));const r=(t+this.top)*this.dataWidth+this.left;return f.arraycopy(this.yuvData,r,e,0,n),e}getMatrix(){const t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.yuvData;const n=t*e,r=new Uint8ClampedArray(n);let o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return f.arraycopy(this.yuvData,o,r,0,n),r;for(let n=0;n<e;n++){const e=n*t;f.arraycopy(this.yuvData,o,r,e,t),o+=this.dataWidth}return r}isCropSupported(){return!0}crop(t,e,n,r){return new xn(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+e,n,r,!1)}renderThumbnail(){const t=this.getWidth()/xn.THUMBNAIL_SCALE_FACTOR,e=this.getHeight()/xn.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(t*e),r=this.yuvData;let o=this.top*this.dataWidth+this.left;for(let i=0;i<e;i++){const e=i*t;for(let i=0;i<t;i++){const t=255&r[o+i*xn.THUMBNAIL_SCALE_FACTOR];n[e+i]=4278190080|65793*t}o+=this.dataWidth*xn.THUMBNAIL_SCALE_FACTOR}return n}getThumbnailWidth(){return this.getWidth()/xn.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/xn.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(t,e){const n=this.yuvData;for(let r=0,o=this.top*this.dataWidth+this.left;r<e;r++,o+=this.dataWidth){const e=o+t/2;for(let r=o,i=o+t-1;r<e;r++,i--){const t=n[r];n[r]=n[i],n[i]=t}}}invert(){return new x(this)}}xn.THUMBNAIL_SCALE_FACTOR=2;class On extends D{constructor(t,e,n,r,o,i,a){if(super(e,n),this.dataWidth=r,this.dataHeight=o,this.left=i,this.top=a,4===t.BYTES_PER_ELEMENT){const r=e*n,o=new Uint8ClampedArray(r);for(let e=0;e<r;e++){const n=t[e],r=n>>16&255,i=n>>7&510,a=255&n;o[e]=(r+i+a)/4&255}this.luminances=o}else this.luminances=t;if(void 0===r&&(this.dataWidth=e),void 0===o&&(this.dataHeight=n),void 0===i&&(this.left=0),void 0===a&&(this.top=0),this.left+e>this.dataWidth||this.top+n>this.dataHeight)throw new d("Crop rectangle does not fit within image data.")}getRow(t,e){if(t<0||t>=this.getHeight())throw new d("Requested row is outside the image: "+t);const n=this.getWidth();(null==e||e.length<n)&&(e=new Uint8ClampedArray(n));const r=(t+this.top)*this.dataWidth+this.left;return f.arraycopy(this.luminances,r,e,0,n),e}getMatrix(){const t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.luminances;const n=t*e,r=new Uint8ClampedArray(n);let o=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return f.arraycopy(this.luminances,o,r,0,n),r;for(let n=0;n<e;n++){const e=n*t;f.arraycopy(this.luminances,o,r,e,t),o+=this.dataWidth}return r}isCropSupported(){return!0}crop(t,e,n,r){return new On(this.luminances,n,r,this.dataWidth,this.dataHeight,this.left+t,this.top+e)}invert(){return new x(this)}}class Mn extends I{static forName(t){return this.getCharacterSetECIByName(t)}}class Pn{}Pn.ISO_8859_1=I.ISO8859_1;class Bn{isCompact(){return this.compact}setCompact(t){this.compact=t}getSize(){return this.size}setSize(t){this.size=t}getLayers(){return this.layers}setLayers(t){this.layers=t}getCodeWords(){return this.codeWords}setCodeWords(t){this.codeWords=t}getMatrix(){return this.matrix}setMatrix(t){this.matrix=t}}class Fn{static singletonList(t){return[t]}static min(t,e){return t.sort(e)[0]}}class Ln{constructor(t){this.previous=t}getPrevious(){return this.previous}}class qn extends Ln{constructor(t,e,n){super(t),this.value=e,this.bitCount=n}appendTo(t,e){t.appendBits(this.value,this.bitCount)}add(t,e){return new qn(this,t,e)}addBinaryShift(t,e){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new qn(this,t,e)}toString(){let t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+w.toBinaryString(t|1<<this.bitCount).substring(1)+">"}}class Vn extends qn{constructor(t,e,n){super(t,0,0),this.binaryShiftStart=e,this.binaryShiftByteCount=n}appendTo(t,e){for(let n=0;n<this.binaryShiftByteCount;n++)(0===n||31===n&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):0===n?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+n],8)}addBinaryShift(t,e){return new Vn(this,t,e)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function Hn(t,e,n){return new Vn(t,e,n)}function Un(t,e,n){return new qn(t,e,n)}const zn=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Wn=0,jn=1,Gn=2,Xn=3,Qn=4,Yn=new qn(null,0,0),Zn=[Int32Array.from([0,327708,327710,327709,656318]),Int32Array.from([590318,0,327710,327709,656318]),Int32Array.from([262158,590300,0,590301,932798]),Int32Array.from([327709,327708,656318,0,327710]),Int32Array.from([327711,656380,656382,656381,0])];function Kn(t){for(let e of t)g.fill(e,-1);return t[Wn][Qn]=0,t[jn][Qn]=0,t[jn][Wn]=28,t[Xn][Qn]=0,t[Gn][Qn]=0,t[Gn][Wn]=15,t}const Jn=Kn(g.createInt32Array(6,6));class tr{constructor(t,e,n,r){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=r}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(t,e){let n=this.bitCount,r=this.token;if(t!==this.mode){let e=Zn[this.mode][t];r=Un(r,65535&e,e>>16),n+=e>>16}let o=t===Gn?4:5;return r=Un(r,e,o),new tr(r,t,0,n+o)}shiftAndAppend(t,e){let n=this.token,r=this.mode===Gn?4:5;return n=Un(n,Jn[this.mode][t],r),n=Un(n,e,5),new tr(n,this.mode,0,this.bitCount+r+5)}addBinaryShiftChar(t){let e=this.token,n=this.mode,r=this.bitCount;if(this.mode===Qn||this.mode===Gn){let t=Zn[n][Wn];e=Un(e,65535&t,t>>16),r+=t>>16,n=Wn}let o=0===this.binaryShiftByteCount||31===this.binaryShiftByteCount?18:62===this.binaryShiftByteCount?9:8,i=new tr(e,n,this.binaryShiftByteCount+1,r+o);return 2078===i.binaryShiftByteCount&&(i=i.endBinaryShift(t+1)),i}endBinaryShift(t){if(0===this.binaryShiftByteCount)return this;let e=this.token;return e=Hn(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new tr(e,this.mode,0,this.bitCount)}isBetterThanOrEqualTo(t){let e=this.bitCount+(Zn[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?e+=tr.calculateBinaryShiftCost(t)-tr.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount}toBitArray(t){let e=[];for(let n=this.endBinaryShift(t.length).token;null!==n;n=n.getPrevious())e.unshift(n);let n=new $;for(const r of e)r.appendTo(n,t);return n}toString(){return A.format("%s bits=%d bytes=%d",zn[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0}}function er(t){const e=A.getCharCode(" "),n=A.getCharCode("."),r=A.getCharCode(",");t[Wn][e]=1;const o=A.getCharCode("Z"),i=A.getCharCode("A");for(let e=i;e<=o;e++)t[Wn][e]=e-i+2;t[jn][e]=1;const a=A.getCharCode("z"),s=A.getCharCode("a");for(let e=s;e<=a;e++)t[jn][e]=e-s+2;t[Gn][e]=1;const c=A.getCharCode("9"),l=A.getCharCode("0");for(let e=l;e<=c;e++)t[Gn][e]=e-l+2;t[Gn][r]=12,t[Gn][n]=13;const d=["\0"," ","","","","","","","","\b","\t","\n","\v","\f","\r","","","","","","@","\\","^","_","`","|","~",""];for(let e=0;e<d.length;e++)t[Xn][A.getCharCode(d[e])]=e;const u=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let e=0;e<u.length;e++)A.getCharCode(u[e])>0&&(t[Qn][A.getCharCode(u[e])]=e);return t}tr.INITIAL_STATE=new tr(Yn,Wn,0,0);const nr=er(g.createInt32Array(5,256));class rr{constructor(t){this.text=t}encode(){const t=A.getCharCode(" "),e=A.getCharCode("\n");let n=Fn.singletonList(tr.INITIAL_STATE);for(let r=0;r<this.text.length;r++){let o,i=r+1<this.text.length?this.text[r+1]:0;switch(this.text[r]){case A.getCharCode("\r"):o=i===e?2:0;break;case A.getCharCode("."):o=i===t?3:0;break;case A.getCharCode(","):o=i===t?4:0;break;case A.getCharCode(":"):o=i===t?5:0;break;default:o=0}o>0?(n=rr.updateStateListForPair(n,r,o),r++):n=this.updateStateListForChar(n,r)}return Fn.min(n,(t,e)=>t.getBitCount()-e.getBitCount()).toBitArray(this.text)}updateStateListForChar(t,e){const n=[];for(let r of t)this.updateStateForChar(r,e,n);return rr.simplifyStates(n)}updateStateForChar(t,e,n){let r=255&this.text[e],o=nr[t.getMode()][r]>0,i=null;for(let a=0;a<=Qn;a++){let s=nr[a][r];if(s>0){if(null==i&&(i=t.endBinaryShift(e)),!o||a===t.getMode()||a===Gn){const t=i.latchAndAppend(a,s);n.push(t)}if(!o&&Jn[t.getMode()][a]>=0){const t=i.shiftAndAppend(a,s);n.push(t)}}}if(t.getBinaryShiftByteCount()>0||0===nr[t.getMode()][r]){let r=t.addBinaryShiftChar(e);n.push(r)}}static updateStateListForPair(t,e,n){const r=[];for(let o of t)this.updateStateForPair(o,e,n,r);return this.simplifyStates(r)}static updateStateForPair(t,e,n,r){let o=t.endBinaryShift(e);if(r.push(o.latchAndAppend(Qn,n)),t.getMode()!==Qn&&r.push(o.shiftAndAppend(Qn,n)),3===n||4===n){let t=o.latchAndAppend(Gn,16-n).latchAndAppend(Gn,1);r.push(t)}if(t.getBinaryShiftByteCount()>0){let n=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);r.push(n)}}static simplifyStates(t){let e=[];for(const n of t){let t=!0;for(const r of e){if(r.isBetterThanOrEqualTo(n)){t=!1;break}n.isBetterThanOrEqualTo(r)&&(e=e.filter(t=>t!==r))}t&&e.push(n)}return e}}class or{constructor(){}static encodeBytes(t){return or.encode(t,or.DEFAULT_EC_PERCENT,or.DEFAULT_AZTEC_LAYERS)}static encode(t,e,n){let r,o,i,a,s,c=new rr(t).encode(),l=w.truncDivision(c.getSize()*e,100)+11,u=c.getSize()+l;if(n!==or.DEFAULT_AZTEC_LAYERS){if(r=n<0,o=Math.abs(n),o>(r?or.MAX_NB_BITS_COMPACT:or.MAX_NB_BITS))throw new d(A.format("Illegal value %s for layers",n));i=or.totalBitsInLayer(o,r),a=or.WORD_SIZE[o];let t=i-i%a;if(s=or.stuffBits(c,a),s.getSize()+l>t)throw new d("Data to large for user specified layer");if(r&&s.getSize()>64*a)throw new d("Data to large for user specified layer")}else{a=0,s=null;for(let t=0;;t++){if(t>or.MAX_NB_BITS)throw new d("Data too large for an Aztec code");if(r=t<=3,o=r?t+1:t,i=or.totalBitsInLayer(o,r),u>i)continue;null!=s&&a===or.WORD_SIZE[o]||(a=or.WORD_SIZE[o],s=or.stuffBits(c,a));let e=i-i%a;if(!(r&&s.getSize()>64*a)&&s.getSize()+l<=e)break}}let h,m=or.generateCheckWords(s,i,a),f=s.getSize()/a,p=or.generateModeMessage(r,o,f),_=(r?11:14)+4*o,g=new Int32Array(_);if(r){h=_;for(let t=0;t<g.length;t++)g[t]=t}else{h=_+1+2*w.truncDivision(w.truncDivision(_,2)-1,15);let t=w.truncDivision(_,2),e=w.truncDivision(h,2);for(let n=0;n<t;n++){let r=n+w.truncDivision(n,15);g[t-n-1]=e-r-1,g[t+n]=e+r+1}}let $=new k(h);for(let t=0,e=0;t<o;t++){let n=4*(o-t)+(r?9:12);for(let r=0;r<n;r++){let o=2*r;for(let i=0;i<2;i++)m.get(e+o+i)&&$.set(g[2*t+i],g[2*t+r]),m.get(e+2*n+o+i)&&$.set(g[2*t+r],g[_-1-2*t-i]),m.get(e+4*n+o+i)&&$.set(g[_-1-2*t-i],g[_-1-2*t-r]),m.get(e+6*n+o+i)&&$.set(g[_-1-2*t-r],g[2*t+i])}e+=8*n}if(or.drawModeMessage($,r,h,p),r)or.drawBullsEye($,w.truncDivision(h,2),5);else{or.drawBullsEye($,w.truncDivision(h,2),7);for(let t=0,e=0;t<w.truncDivision(_,2)-1;t+=15,e+=16)for(let t=1&w.truncDivision(h,2);t<h;t+=2)$.set(w.truncDivision(h,2)-e,t),$.set(w.truncDivision(h,2)+e,t),$.set(t,w.truncDivision(h,2)-e),$.set(t,w.truncDivision(h,2)+e)}let y=new Bn;return y.setCompact(r),y.setSize(h),y.setLayers(o),y.setCodeWords(f),y.setMatrix($),y}static drawBullsEye(t,e,n){for(let r=0;r<n;r+=2)for(let n=e-r;n<=e+r;n++)t.set(n,e-r),t.set(n,e+r),t.set(e-r,n),t.set(e+r,n);t.set(e-n,e-n),t.set(e-n+1,e-n),t.set(e-n,e-n+1),t.set(e+n,e-n),t.set(e+n,e-n+1),t.set(e+n,e+n-1)}static generateModeMessage(t,e,n){let r=new $;return t?(r.appendBits(e-1,2),r.appendBits(n-1,6),r=or.generateCheckWords(r,28,4)):(r.appendBits(e-1,5),r.appendBits(n-1,11),r=or.generateCheckWords(r,40,4)),r}static drawModeMessage(t,e,n,r){let o=w.truncDivision(n,2);if(e)for(let e=0;e<7;e++){let n=o-3+e;r.get(e)&&t.set(n,o-5),r.get(e+7)&&t.set(o+5,n),r.get(20-e)&&t.set(n,o+5),r.get(27-e)&&t.set(o-5,n)}else for(let e=0;e<10;e++){let n=o-5+e+w.truncDivision(e,5);r.get(e)&&t.set(n,o-7),r.get(e+10)&&t.set(o+7,n),r.get(29-e)&&t.set(n,o+7),r.get(39-e)&&t.set(o-7,n)}}static generateCheckWords(t,e,n){let r=t.getSize()/n,o=new vn(or.getGF(n)),i=w.truncDivision(e,n),a=or.bitsToWords(t,n,i);o.encode(a,i-r);let s=e%n,c=new $;c.appendBits(0,s);for(const t of Array.from(a))c.appendBits(t,n);return c}static bitsToWords(t,e,n){let r,o,i=new Int32Array(n);for(r=0,o=t.getSize()/e;r<o;r++){let n=0;for(let o=0;o<e;o++)n|=t.get(r*e+o)?1<<e-o-1:0;i[r]=n}return i}static getGF(t){switch(t){case 4:return J.AZTEC_PARAM;case 6:return J.AZTEC_DATA_6;case 8:return J.AZTEC_DATA_8;case 10:return J.AZTEC_DATA_10;case 12:return J.AZTEC_DATA_12;default:throw new d("Unsupported word size "+t)}}static stuffBits(t,e){let n=new $,r=t.getSize(),o=(1<<e)-2;for(let i=0;i<r;i+=e){let a=0;for(let n=0;n<e;n++)(i+n>=r||t.get(i+n))&&(a|=1<<e-1-n);(a&o)===o?(n.appendBits(a&o,e),i--):0===(a&o)?(n.appendBits(1|a,e),i--):n.appendBits(a,e)}return n}static totalBitsInLayer(t,e){return((e?88:112)+16*t)*t}}or.DEFAULT_EC_PERCENT=33,or.DEFAULT_AZTEC_LAYERS=0,or.MAX_NB_BITS=32,or.MAX_NB_BITS_COMPACT=4,or.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class ir{encode(t,e,n,r){return this.encodeWithHints(t,e,n,r,null)}encodeWithHints(t,e,n,r,o){let i=Pn.ISO_8859_1,a=or.DEFAULT_EC_PERCENT,s=or.DEFAULT_AZTEC_LAYERS;return null!=o&&(o.has(bn.CHARACTER_SET)&&(i=Mn.forName(o.get(bn.CHARACTER_SET).toString())),o.has(bn.ERROR_CORRECTION)&&(a=w.parseInt(o.get(bn.ERROR_CORRECTION).toString())),o.has(bn.AZTEC_LAYERS)&&(s=w.parseInt(o.get(bn.AZTEC_LAYERS).toString()))),ir.encodeLayers(t,e,n,r,i,a,s)}static encodeLayers(t,e,n,r,o,i,a){if(e!==V.AZTEC)throw new d("Can only encode AZTEC, but got "+e);let s=or.encode(A.getBytes(t,o),i,a);return ir.renderResult(s,n,r)}static renderResult(t,e,n){let r=t.getMatrix();if(null==r)throw new et;let o=r.getWidth(),i=r.getHeight(),a=Math.max(e,o),s=Math.max(n,i),c=Math.min(a/o,s/i),l=(a-o*c)/2,d=(s-i*c)/2,u=new k(a,s);for(let t=0,e=d;t<i;t++,e+=c)for(let n=0,i=l;n<o;n++,i+=c)r.get(n,t)&&u.setRegion(i,e,c,c);return u}}t.AbstractExpandedDecoder=zt,t.ArgumentException=l,t.ArithmeticException=K,t.AztecCode=Bn,t.AztecCodeReader=_t,t.AztecCodeWriter=ir,t.AztecDecoder=rt,t.AztecDetector=pt,t.AztecDetectorResult=ct,t.AztecEncoder=or,t.AztecHighLevelEncoder=rr,t.AztecPoint=ft,t.BarcodeFormat=V,t.Binarizer=m,t.BinaryBitmap=u,t.BitArray=$,t.BitMatrix=k,t.BitSource=fe,t.BrowserAztecCodeReader=gt,t.BrowserBarcodeReader=ce,t.BrowserCodeReader=F,t.BrowserDatamatrixCodeReader=$e,t.BrowserMultiFormatReader=gn,t.BrowserPDF417Reader=wn,t.BrowserQRCodeReader=$n,t.BrowserQRCodeSvgWriter=Rn,t.CharacterSetECI=I,t.ChecksumException=h,t.Code128Reader=$t,t.Code39Reader=yt,t.DataMatrixDecodedBitStreamParser=pe,t.DataMatrixReader=we,t.DecodeHintType=b,t.DecoderResult=Q,t.DefaultGridSampler=ht,t.DetectorResult=st,t.EAN13Reader=St,t.EncodeHintType=bn,t.Exception=c,t.FormatException=v,t.GenericGF=J,t.GenericGFPoly=Z,t.GlobalHistogramBinarizer=R,t.GridSampler=dt,t.GridSamplerInstance=mt,t.HTMLCanvasElementLuminanceSource=O,t.HybridBinarizer=N,t.ITFReader=bt,t.IllegalArgumentException=d,t.IllegalStateException=et,t.InvertedLuminanceSource=x,t.LuminanceSource=D,t.MathUtils=ot,t.MultiFormatOneDReader=se,t.MultiFormatReader=_n,t.MultiFormatWriter=Dn,t.NotFoundException=T,t.OneDReader=wt,t.PDF417DecodedBitStreamParser=hn,t.PDF417DecoderErrorCorrection=We,t.PDF417Reader=fn,t.PDF417ResultMetadata=en,t.PerspectiveTransform=ut,t.PlanarYUVLuminanceSource=xn,t.QRCodeByteMatrix=Cn,t.QRCodeDataMask=Ee,t.QRCodeDecodedBitStreamParser=Te,t.QRCodeDecoderErrorCorrectionLevel=ye,t.QRCodeDecoderFormatInformation=be,t.QRCodeEncoder=Tn,t.QRCodeEncoderQRCode=En,t.QRCodeMaskUtil=In,t.QRCodeMatrixUtil=Sn,t.QRCodeMode=ke,t.QRCodeReader=Fe,t.QRCodeVersion=Ce,t.QRCodeWriter=Nn,t.RGBLuminanceSource=On,t.RSS14Reader=ae,t.RSSExpandedReader=oe,t.ReaderException=pn,t.ReedSolomonDecoder=nt,t.ReedSolomonEncoder=vn,t.ReedSolomonException=tt,t.Result=L,t.ResultMetadataType=X,t.ResultPoint=at,t.StringUtils=A,t.UnsupportedOperationException=C,t.VideoInputDevice=M,t.WhiteRectangleDetector=lt,t.WriterException=An,t.ZXingArrays=g,t.ZXingCharset=Mn,t.ZXingInteger=w,t.ZXingStandardCharsets=Pn,t.ZXingStringBuilder=S,t.ZXingStringEncoding=E,t.ZXingSystem=f,t.createAbstractExpandedDecoder=ee,Object.defineProperty(t,"__esModule",{value:!0})}(e)}),zxingJs_umd$1=getDefaultExportFromCjs(zxingJs_umd),ZXing=_mergeNamespaces({__proto__:null,default:zxingJs_umd$1},[zxingJs_umd]),ZXingHtml5QrcodeDecoder=function(){function t(t,e,n){if(this.formatMap=new Map([[Html5QrcodeSupportedFormats.QR_CODE,zxingJs_umd.BarcodeFormat.QR_CODE],[Html5QrcodeSupportedFormats.AZTEC,zxingJs_umd.BarcodeFormat.AZTEC],[Html5QrcodeSupportedFormats.CODABAR,zxingJs_umd.BarcodeFormat.CODABAR],[Html5QrcodeSupportedFormats.CODE_39,zxingJs_umd.BarcodeFormat.CODE_39],[Html5QrcodeSupportedFormats.CODE_93,zxingJs_umd.BarcodeFormat.CODE_93],[Html5QrcodeSupportedFormats.CODE_128,zxingJs_umd.BarcodeFormat.CODE_128],[Html5QrcodeSupportedFormats.DATA_MATRIX,zxingJs_umd.BarcodeFormat.DATA_MATRIX],[Html5QrcodeSupportedFormats.MAXICODE,zxingJs_umd.BarcodeFormat.MAXICODE],[Html5QrcodeSupportedFormats.ITF,zxingJs_umd.BarcodeFormat.ITF],[Html5QrcodeSupportedFormats.EAN_13,zxingJs_umd.BarcodeFormat.EAN_13],[Html5QrcodeSupportedFormats.EAN_8,zxingJs_umd.BarcodeFormat.EAN_8],[Html5QrcodeSupportedFormats.PDF_417,zxingJs_umd.BarcodeFormat.PDF_417],[Html5QrcodeSupportedFormats.RSS_14,zxingJs_umd.BarcodeFormat.RSS_14],[Html5QrcodeSupportedFormats.RSS_EXPANDED,zxingJs_umd.BarcodeFormat.RSS_EXPANDED],[Html5QrcodeSupportedFormats.UPC_A,zxingJs_umd.BarcodeFormat.UPC_A],[Html5QrcodeSupportedFormats.UPC_E,zxingJs_umd.BarcodeFormat.UPC_E],[Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION,zxingJs_umd.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!ZXing)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=e,this.logger=n;var r=this.createZXingFormats(t),o=new Map;o.set(zxingJs_umd.DecodeHintType.POSSIBLE_FORMATS,r),o.set(zxingJs_umd.DecodeHintType.TRY_HARDER,!1),this.hints=o}return t.prototype.decodeAsync=function(t){var e=this;return new Promise(function(n,r){try{n(e.decode(t))}catch(t){r(t)}})},t.prototype.decode=function(t){var e=new zxingJs_umd.MultiFormatReader(this.verbose,this.hints),n=new zxingJs_umd.HTMLCanvasElementLuminanceSource(t),r=new zxingJs_umd.BinaryBitmap(new zxingJs_umd.HybridBinarizer(n)),o=e.decode(r);return{text:o.text,format:QrcodeResultFormat.create(this.toHtml5QrcodeSupportedFormats(o.format)),debugData:this.createDebugData()}},t.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(e,n,r){t.set(e,n)}),t},t.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},t.prototype.createZXingFormats=function(t){for(var e=[],n=0,r=t;n<r.length;n++){var o=r[n];this.formatMap.has(o)?e.push(this.formatMap.get(o)):this.logger.logError("".concat(o," is not supported by")+"ZXingHtml5QrcodeShim")}return e},t.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},t}(),__awaiter$4=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$4=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},BarcodeDetectorDelegate=function(){function t(e,n,r){if(this.formatMap=new Map([[Html5QrcodeSupportedFormats.QR_CODE,"qr_code"],[Html5QrcodeSupportedFormats.AZTEC,"aztec"],[Html5QrcodeSupportedFormats.CODABAR,"codabar"],[Html5QrcodeSupportedFormats.CODE_39,"code_39"],[Html5QrcodeSupportedFormats.CODE_93,"code_93"],[Html5QrcodeSupportedFormats.CODE_128,"code_128"],[Html5QrcodeSupportedFormats.DATA_MATRIX,"data_matrix"],[Html5QrcodeSupportedFormats.ITF,"itf"],[Html5QrcodeSupportedFormats.EAN_13,"ean_13"],[Html5QrcodeSupportedFormats.EAN_8,"ean_8"],[Html5QrcodeSupportedFormats.PDF_417,"pdf417"],[Html5QrcodeSupportedFormats.UPC_A,"upc_a"],[Html5QrcodeSupportedFormats.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!t.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=n,this.logger=r;var o=this.createBarcodeDetectorFormats(e);if(this.detector=new BarcodeDetector(o),!this.detector)throw"BarcodeDetector detector not supported"}return t.isSupported=function(){return"BarcodeDetector"in window&&void 0!==new BarcodeDetector({formats:["qr_code"]})},t.prototype.decodeAsync=function(t){return __awaiter$4(this,void 0,void 0,function(){var e,n;return __generator$4(this,function(r){switch(r.label){case 0:return[4,this.detector.detect(t)];case 1:if(!(e=r.sent())||0===e.length)throw"No barcode or QR code detected.";return[2,{text:(n=this.selectLargestBarcode(e)).rawValue,format:QrcodeResultFormat.create(this.toHtml5QrcodeSupportedFormats(n.format)),debugData:this.createDebugData()}]}})})},t.prototype.selectLargestBarcode=function(t){for(var e=null,n=0,r=0,o=t;r<o.length;r++){var i=o[r],a=i.boundingBox.width*i.boundingBox.height;a>n&&(n=a,e=i)}if(!e)throw"No largest barcode found";return e},t.prototype.createBarcodeDetectorFormats=function(t){for(var e=[],n=0,r=t;n<r.length;n++){var o=r[n];this.formatMap.has(o)?e.push(this.formatMap.get(o)):this.logger.warn("".concat(o," is not supported by")+"BarcodeDetectorDelegate")}return{formats:e}},t.prototype.toHtml5QrcodeSupportedFormats=function(t){if(!this.reverseFormatMap.has(t))throw"reverseFormatMap doesn't have ".concat(t);return this.reverseFormatMap.get(t)},t.prototype.createReverseFormatMap=function(){var t=new Map;return this.formatMap.forEach(function(e,n,r){t.set(e,n)}),t},t.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},t}(),__awaiter$3=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$3=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},Html5QrcodeShim=function(){function t(t,e,n,r){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=n,e&&BarcodeDetectorDelegate.isSupported()?(this.primaryDecoder=new BarcodeDetectorDelegate(t,n,r),this.secondaryDecoder=new ZXingHtml5QrcodeDecoder(t,n,r)):this.primaryDecoder=new ZXingHtml5QrcodeDecoder(t,n,r)}return t.prototype.decodeAsync=function(t){return __awaiter$3(this,void 0,void 0,function(){var e;return __generator$3(this,function(n){switch(n.label){case 0:e=performance.now(),n.label=1;case 1:return n.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(t)];case 2:return[2,n.sent()];case 3:return this.possiblyLogPerformance(e),[7];case 4:return[2]}})})},t.prototype.decodeRobustlyAsync=function(t){return __awaiter$3(this,void 0,void 0,function(){var e,n;return __generator$3(this,function(r){switch(r.label){case 0:e=performance.now(),r.label=1;case 1:return r.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(t)];case 2:return[2,r.sent()];case 3:if(n=r.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(t)];throw n;case 4:return this.possiblyLogPerformance(e),[7];case 5:return[2]}})})},t.prototype.getDecoder=function(){return this.secondaryDecoder?!1===this.wasPrimaryDecoderUsedInLastDecode?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},t.prototype.possiblyLogPerformance=function(t){if(this.verbose){var e=performance.now()-t;this.executionResults.push(e),this.executions++,this.possiblyFlushPerformanceReport()}},t.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var t=0,e=0,n=this.executionResults;e<n.length;e++){t+=n[e]}var r=t/this.executionResults.length;console.log("".concat(r," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},t}(),__extends$1=(extendStatics=function(t,e){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},extendStatics(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}extendStatics(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),extendStatics,__awaiter$2=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$2=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},AbstractCameraCapability=function(){function t(t,e){this.name=t,this.track=e}return t.prototype.isSupported=function(){return!!this.track.getCapabilities&&this.name in this.track.getCapabilities()},t.prototype.apply=function(t){var e={};e[this.name]=t;var n={advanced:[e]};return this.track.applyConstraints(n)},t.prototype.value=function(){var t=this.track.getSettings();return this.name in t?t[this.name]:null},t}(),AbstractRangeCameraCapability=function(t){function e(e,n){return t.call(this,e,n)||this}return __extends$1(e,t),e.prototype.min=function(){return this.getCapabilities().min},e.prototype.max=function(){return this.getCapabilities().max},e.prototype.step=function(){return this.getCapabilities().step},e.prototype.apply=function(t){var e={};e[this.name]=t;var n={advanced:[e]};return this.track.applyConstraints(n)},e.prototype.getCapabilities=function(){this.failIfNotSupported();var t=this.track.getCapabilities()[this.name];return{min:t.min,max:t.max,step:t.step}},e.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},e}(AbstractCameraCapability),ZoomFeatureImpl=function(t){function e(e){return t.call(this,"zoom",e)||this}return __extends$1(e,t),e}(AbstractRangeCameraCapability),TorchFeatureImpl=function(t){function e(e){return t.call(this,"torch",e)||this}return __extends$1(e,t),e}(AbstractCameraCapability),CameraCapabilitiesImpl=function(){function t(t){this.track=t}return t.prototype.zoomFeature=function(){return new ZoomFeatureImpl(this.track)},t.prototype.torchFeature=function(){return new TorchFeatureImpl(this.track)},t}(),RenderedCameraImpl=function(){function t(t,e,n){this.isClosed=!1,this.parentElement=t,this.mediaStream=e,this.callbacks=n,this.surface=this.createVideoElement(this.parentElement.clientWidth),t.append(this.surface)}return t.prototype.createVideoElement=function(t){var e=document.createElement("video");return e.style.width="".concat(t,"px"),e.style.display="block",e.muted=!0,e.setAttribute("muted","true"),e.playsInline=!0,e},t.prototype.setupSurface=function(){var t=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var e=function(){var n=t.surface.clientWidth,r=t.surface.clientHeight;t.callbacks.onRenderSurfaceReady(n,r),t.surface.removeEventListener("playing",e)};this.surface.addEventListener("playing",e),this.surface.srcObject=this.mediaStream,this.surface.play()},t.create=function(e,n,r,o){return __awaiter$2(this,void 0,void 0,function(){var i,a;return __generator$2(this,function(s){switch(s.label){case 0:return i=new t(e,n,o),r.aspectRatio?(a={aspectRatio:r.aspectRatio},[4,i.getFirstTrackOrFail().applyConstraints(a)]):[3,2];case 1:s.sent(),s.label=2;case 2:return i.setupSurface(),[2,i]}})})},t.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},t.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),0===this.mediaStream.getVideoTracks().length)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},t.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},t.prototype.resume=function(t){this.failIfClosed();var e=this,n=function(){setTimeout(t,200),e.surface.removeEventListener("playing",n)};this.surface.addEventListener("playing",n),this.surface.play()},t.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},t.prototype.getSurface=function(){return this.failIfClosed(),this.surface},t.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},t.prototype.applyVideoConstraints=function(t){return __awaiter$2(this,void 0,void 0,function(){return __generator$2(this,function(e){if("aspectRatio"in t)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(t)]})})},t.prototype.close=function(){if(this.isClosed)return Promise.resolve();var t=this;return new Promise(function(e,n){var r=t.mediaStream.getVideoTracks().length,o=0;t.mediaStream.getVideoTracks().forEach(function(n){t.mediaStream.removeTrack(n),n.stop(),++o>=r&&(t.isClosed=!0,t.parentElement.removeChild(t.surface),e())})})},t.prototype.getCapabilities=function(){return new CameraCapabilitiesImpl(this.getFirstTrackOrFail())},t}(),CameraImpl=function(){function t(t){this.mediaStream=t}return t.prototype.render=function(t,e,n){return __awaiter$2(this,void 0,void 0,function(){return __generator$2(this,function(r){return[2,RenderedCameraImpl.create(t,this.mediaStream,e,n)]})})},t.create=function(e){return __awaiter$2(this,void 0,void 0,function(){var n;return __generator$2(this,function(r){switch(r.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return n={audio:!1,video:e},[4,navigator.mediaDevices.getUserMedia(n)];case 1:return[2,new t(r.sent())]}})})},t}(),__awaiter$1=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator$1=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},CameraFactory=function(){function t(){}return t.failIfNotSupported=function(){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function(e){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new t]})})},t.prototype.create=function(t){return __awaiter$1(this,void 0,void 0,function(){return __generator$1(this,function(e){return[2,CameraImpl.create(t)]})})},t}(),__awaiter=function(t,e,n,r){return new(n||(n=Promise))(function(o,i){function a(t){try{c(r.next(t))}catch(t){i(t)}}function s(t){try{c(r.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(a,s)}c((r=r.apply(t,e||[])).next())})},__generator=function(t,e){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,r=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},CameraRetriever=function(){function t(){}return t.retrieve=function(){if(navigator.mediaDevices)return t.getCamerasFromMediaDevices();var e=MediaStreamTrack;return MediaStreamTrack&&e.getSources?t.getCamerasFromMediaStreamTrack():t.rejectWithError()},t.rejectWithError=function(){var e=Html5QrcodeStrings.unableToQuerySupportedDevices();return t.isHttpsOrLocalhost()||(e=Html5QrcodeStrings.insecureContextCameraQueryError()),Promise.reject(e)},t.isHttpsOrLocalhost=function(){if("https:"===location.protocol)return!0;var t=location.host.split(":")[0];return"127.0.0.1"===t||"localhost"===t},t.getCamerasFromMediaDevices=function(){return __awaiter(this,void 0,void 0,function(){var t,e,n,r,o,i,a;return __generator(this,function(s){switch(s.label){case 0:return t=function(t){for(var e=0,n=t.getVideoTracks();e<n.length;e++){var r=n[e];r.enabled=!1,r.stop(),t.removeTrack(r)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return e=s.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(n=s.sent(),r=[],o=0,i=n;o<i.length;o++)"videoinput"===(a=i[o]).kind&&r.push({id:a.deviceId,label:a.label});return t(e),[2,r]}})})},t.getCamerasFromMediaStreamTrack=function(){return new Promise(function(t,e){MediaStreamTrack.getSources(function(e){for(var n=[],r=0,o=e;r<o.length;r++){var i=o[r];"video"===i.kind&&n.push({id:i.id,label:i.label})}t(n)})})},t}(),Html5QrcodeScannerState;!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.NOT_STARTED=1]="NOT_STARTED",t[t.SCANNING=2]="SCANNING",t[t.PAUSED=3]="PAUSED"}(Html5QrcodeScannerState||(Html5QrcodeScannerState={}));var StateManagerImpl=function(){function t(){this.state=Html5QrcodeScannerState.NOT_STARTED,this.onGoingTransactionNewState=Html5QrcodeScannerState.UNKNOWN}return t.prototype.directTransition=function(t){this.failIfTransitionOngoing(),this.validateTransition(t),this.state=t},t.prototype.startTransition=function(t){return this.failIfTransitionOngoing(),this.validateTransition(t),this.onGoingTransactionNewState=t,this},t.prototype.execute=function(){if(this.onGoingTransactionNewState===Html5QrcodeScannerState.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var t=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Html5QrcodeScannerState.UNKNOWN,this.directTransition(t)},t.prototype.cancel=function(){if(this.onGoingTransactionNewState===Html5QrcodeScannerState.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Html5QrcodeScannerState.UNKNOWN},t.prototype.getState=function(){return this.state},t.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Html5QrcodeScannerState.UNKNOWN)throw"Cannot transition to a new state, already under transition"},t.prototype.validateTransition=function(t){switch(this.state){case Html5QrcodeScannerState.UNKNOWN:throw"Transition from unknown is not allowed";case Html5QrcodeScannerState.NOT_STARTED:this.failIfNewStateIs(t,[Html5QrcodeScannerState.PAUSED]);case Html5QrcodeScannerState.SCANNING:case Html5QrcodeScannerState.PAUSED:}},t.prototype.failIfNewStateIs=function(t,e){for(var n=0,r=e;n<r.length;n++){if(t===r[n])throw"Cannot transition from ".concat(this.state," to ").concat(t)}},t}(),StateManagerProxy=function(){function t(t){this.stateManager=t}return t.prototype.startTransition=function(t){return this.stateManager.startTransition(t)},t.prototype.directTransition=function(t){this.stateManager.directTransition(t)},t.prototype.getState=function(){return this.stateManager.getState()},t.prototype.canScanFile=function(){return this.stateManager.getState()===Html5QrcodeScannerState.NOT_STARTED},t.prototype.isScanning=function(){return this.stateManager.getState()!==Html5QrcodeScannerState.NOT_STARTED},t.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Html5QrcodeScannerState.SCANNING},t.prototype.isPaused=function(){return this.stateManager.getState()===Html5QrcodeScannerState.PAUSED},t}(),StateManagerFactory=function(){function t(){}return t.create=function(){return new StateManagerProxy(new StateManagerImpl)},t}(),__extends=function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}(),Constants=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return __extends(e,t),e.DEFAULT_WIDTH=300,e.DEFAULT_WIDTH_OFFSET=2,e.FILE_SCAN_MIN_HEIGHT=300,e.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,e.MIN_QR_BOX_SIZE=50,e.SHADED_LEFT=1,e.SHADED_RIGHT=2,e.SHADED_TOP=3,e.SHADED_BOTTOM=4,e.SHADED_REGION_ELEMENT_ID="qr-shaded-region",e.VERBOSE=!1,e.BORDER_SHADER_DEFAULT_COLOR="#ffffff",e.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",e}(Html5QrcodeConstants),InternalHtml5QrcodeConfig=function(){function t(t,e){this.logger=e,this.fps=Constants.SCAN_DEFAULT_FPS,t?(t.fps&&(this.fps=t.fps),this.disableFlip=!0===t.disableFlip,this.qrbox=t.qrbox,this.aspectRatio=t.aspectRatio,this.videoConstraints=t.videoConstraints):this.disableFlip=Constants.DEFAULT_DISABLE_FLIP}return t.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?VideoConstraintsUtil.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},t.prototype.isShadedBoxEnabled=function(){return!isNullOrUndefined(this.qrbox)},t.create=function(e,n){return new t(e,n)},t}(),Html5Qrcode=function(){function t(t,e){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(t))throw"HTML Element with id=".concat(t," not found");var n;this.elementId=t,this.verbose=!1,"boolean"==typeof e?this.verbose=!0===e:e&&(n=e,this.verbose=!0===n.verbose,n.experimentalFeatures),this.logger=new BaseLoggger(this.verbose),this.qrcode=new Html5QrcodeShim(this.getSupportedFormats(e),this.getUseBarCodeDetectorIfSupported(n),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=StateManagerFactory.create()}return t.prototype.start=function(t,e,n,r){var o,i=this;if(!t)throw"cameraIdOrConfig is required";if(!n||"function"!=typeof n)throw"qrCodeSuccessCallback is required and should be a function.";o=r||(this.verbose?this.logger.log:function(){});var a=InternalHtml5QrcodeConfig.create(e,this.logger);this.clearElement();var s=!1;a.videoConstraints&&(a.isMediaStreamConstraintsValid()?s=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var c=s,l=document.getElementById(this.elementId);l.clientWidth?l.clientWidth:Constants.DEFAULT_WIDTH,l.style.position="relative",this.shouldScan=!0,this.element=l;var d=this,u=this.stateManagerProxy.startTransition(Html5QrcodeScannerState.SCANNING);return new Promise(function(e,r){var s=c?a.videoConstraints:d.createVideoConstraints(t);if(!s)return u.cancel(),void r("videoConstraints should be defined");var l={};c&&!a.aspectRatio||(l.aspectRatio=a.aspectRatio);var h={onRenderSurfaceReady:function(t,e){d.setupUi(t,e,a),d.isScanning=!0,d.foreverScan(a,n,o)}};CameraFactory.failIfNotSupported().then(function(t){t.create(s).then(function(t){return t.render(i.element,l,h).then(function(t){d.renderedCamera=t,u.execute(),e(null)}).catch(function(t){u.cancel(),r(t)})}).catch(function(t){u.cancel(),r(Html5QrcodeStrings.errorGettingUserMedia(t))})}).catch(function(t){u.cancel(),r(Html5QrcodeStrings.cameraStreamingNotSupported())})})},t.prototype.pause=function(t){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Html5QrcodeScannerState.PAUSED),this.showPausedState(),(isNullOrUndefined(t)||!0!==t)&&(t=!1),t&&this.renderedCamera&&this.renderedCamera.pause()},t.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var t=this,e=function(){t.stateManagerProxy.directTransition(Html5QrcodeScannerState.SCANNING),t.hidePausedState()};this.renderedCamera.isPaused()?this.renderedCamera.resume(function(){e()}):e()},t.prototype.getState=function(){return this.stateManagerProxy.getState()},t.prototype.stop=function(){var t=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var e=this.stateManagerProxy.startTransition(Html5QrcodeScannerState.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var n=this;return this.renderedCamera.close().then(function(){return n.renderedCamera=null,n.element&&(n.element.removeChild(n.canvasElement),n.canvasElement=null),function(){if(t.element){var e=document.getElementById(Constants.SHADED_REGION_ELEMENT_ID);e&&t.element.removeChild(e)}}(),n.qrRegion&&(n.qrRegion=null),n.context&&(n.context=null),e.execute(),n.hidePausedState(),n.isScanning=!1,Promise.resolve()})},t.prototype.scanFile=function(t,e){return this.scanFileV2(t,e).then(function(t){return t.decodedText})},t.prototype.scanFileV2=function(t,e){var n=this;if(!(t&&t instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(isNullOrUndefined(e)&&(e=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(r,o){n.possiblyCloseLastScanImageFile(),n.clearElement(),n.lastScanImageFile=URL.createObjectURL(t);var i=new Image;i.onload=function(){var t=i.width,a=i.height,s=document.getElementById(n.elementId),c=s.clientWidth?s.clientWidth:Constants.DEFAULT_WIDTH,l=Math.max(s.clientHeight?s.clientHeight:a,Constants.FILE_SCAN_MIN_HEIGHT),d=n.computeCanvasDrawConfig(t,a,c,l);if(e){var u=n.createCanvasElement(c,l,"qr-canvas-visible");u.style.display="inline-block",s.appendChild(u);var h=u.getContext("2d");if(!h)throw"Unable to get 2d context from canvas";h.canvas.width=c,h.canvas.height=l,h.drawImage(i,0,0,t,a,d.x,d.y,d.width,d.height)}var m=Constants.FILE_SCAN_HIDDEN_CANVAS_PADDING,f=Math.max(i.width,d.width),p=Math.max(i.height,d.height),_=f+2*m,g=p+2*m,w=n.createCanvasElement(_,g);s.appendChild(w);var $=w.getContext("2d");if(!$)throw"Unable to get 2d context from canvas";$.canvas.width=_,$.canvas.height=g,$.drawImage(i,0,0,t,a,m,m,f,p);try{n.qrcode.decodeRobustlyAsync(w).then(function(t){r(Html5QrcodeResultFactory.createFromQrcodeResult(t))}).catch(o)}catch(t){o("QR code parse error, error = ".concat(t))}},i.onerror=o,i.onabort=o,i.onstalled=o,i.onsuspend=o,i.src=URL.createObjectURL(t)})},t.prototype.clear=function(){this.clearElement()},t.getCameras=function(){return CameraRetriever.retrieve()},t.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},t.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},t.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},t.prototype.applyVideoConstraints=function(t){if(!t)throw"videoConstaints is required argument.";if(!VideoConstraintsUtil.isMediaStreamConstraintsValid(t,this.logger))throw"invalid videoConstaints passed, check logs for more details";return this.getRenderedCameraOrFail().applyVideoConstraints(t)},t.prototype.getRenderedCameraOrFail=function(){if(null==this.renderedCamera)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},t.prototype.getSupportedFormats=function(t){var e=[Html5QrcodeSupportedFormats.QR_CODE,Html5QrcodeSupportedFormats.AZTEC,Html5QrcodeSupportedFormats.CODABAR,Html5QrcodeSupportedFormats.CODE_39,Html5QrcodeSupportedFormats.CODE_93,Html5QrcodeSupportedFormats.CODE_128,Html5QrcodeSupportedFormats.DATA_MATRIX,Html5QrcodeSupportedFormats.MAXICODE,Html5QrcodeSupportedFormats.ITF,Html5QrcodeSupportedFormats.EAN_13,Html5QrcodeSupportedFormats.EAN_8,Html5QrcodeSupportedFormats.PDF_417,Html5QrcodeSupportedFormats.RSS_14,Html5QrcodeSupportedFormats.RSS_EXPANDED,Html5QrcodeSupportedFormats.UPC_A,Html5QrcodeSupportedFormats.UPC_E,Html5QrcodeSupportedFormats.UPC_EAN_EXTENSION];if(!t||"boolean"==typeof t)return e;if(!t.formatsToSupport)return e;if(!Array.isArray(t.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(0===t.formatsToSupport.length)throw"Atleast 1 formatsToSupport is needed.";for(var n=[],r=0,o=t.formatsToSupport;r<o.length;r++){var i=o[r];isValidHtml5QrcodeSupportedFormats(i)?n.push(i):this.logger.warn("Invalid format: ".concat(i," passed in config, ignoring."))}if(0===n.length)throw"None of formatsToSupport match supported values.";return n},t.prototype.getUseBarCodeDetectorIfSupported=function(t){if(isNullOrUndefined(t))return!0;if(!isNullOrUndefined(t.useBarCodeDetectorIfSupported))return!1!==t.useBarCodeDetectorIfSupported;if(isNullOrUndefined(t.experimentalFeatures))return!0;var e=t.experimentalFeatures;return!!isNullOrUndefined(e.useBarCodeDetectorIfSupported)||!1!==e.useBarCodeDetectorIfSupported},t.prototype.validateQrboxSize=function(t,e,n){var r=this,o=n.qrbox;this.validateQrboxConfig(o);var i,a=this.toQrdimensions(t,e,o),s=function(t){if(t<Constants.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(Constants.MIN_QR_BOX_SIZE,"px.")};s(a.width),s(a.height),a.width=((i=a.width)>t&&(r.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),i=t),i)},t.prototype.validateQrboxConfig=function(t){if("number"!=typeof t&&"function"!=typeof t&&(void 0===t.width||void 0===t.height))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},t.prototype.toQrdimensions=function(t,e,n){if("number"==typeof n)return{width:n,height:n};if("function"==typeof n)try{return n(t,e)}catch(t){throw new Error("qrbox config was passed as a function but it failed with unknown error"+t)}return n},t.prototype.setupUi=function(t,e,n){n.isShadedBoxEnabled()&&this.validateQrboxSize(t,e,n);var r=isNullOrUndefined(n.qrbox)?{width:t,height:e}:n.qrbox;this.validateQrboxConfig(r);var o=this.toQrdimensions(t,e,r);o.height>e&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var i=n.isShadedBoxEnabled()&&o.height<=e,a={x:0,y:0,width:t,height:e},s=i?this.getShadedRegionBounds(t,e,o):a,c=this.createCanvasElement(s.width,s.height),l=c.getContext("2d",{willReadFrequently:!0});l.canvas.width=s.width,l.canvas.height=s.height,this.element.append(c),i&&this.possiblyInsertShadingElement(this.element,t,e,o),this.createScannerPausedUiElement(this.element),this.qrRegion=s,this.context=l,this.canvasElement=c},t.prototype.createScannerPausedUiElement=function(t){var e=document.createElement("div");e.innerText=Html5QrcodeStrings.scannerPaused(),e.style.display="none",e.style.position="absolute",e.style.top="0px",e.style.zIndex="1",e.style.background="rgba(9, 9, 9, 0.46)",e.style.color="#FFECEC",e.style.textAlign="center",e.style.width="100%",t.appendChild(e),this.scannerPausedUiElement=e},t.prototype.scanContext=function(t,e){var n=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(e){return t(e.text,Html5QrcodeResultFactory.createFromQrcodeResult(e)),n.possiblyUpdateShaders(!0),!0}).catch(function(t){n.possiblyUpdateShaders(!1);var r=Html5QrcodeStrings.codeParseError(t);return e(r,Html5QrcodeErrorFactory.createFrom(r)),!1})},t.prototype.foreverScan=function(t,e,n){var r=this;if(this.shouldScan&&this.renderedCamera){var o=this.renderedCamera.getSurface(),i=o.videoWidth/o.clientWidth,a=o.videoHeight/o.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var s=this.qrRegion.width*i,c=this.qrRegion.height*a,l=this.qrRegion.x*i,d=this.qrRegion.y*a;this.context.drawImage(o,l,d,s,c,0,0,this.qrRegion.width,this.qrRegion.height);var u=function(){r.foreverScanTimeout=setTimeout(function(){r.foreverScan(t,e,n)},r.getTimeoutFps(t.fps))};this.scanContext(e,n).then(function(o){o||!0===t.disableFlip?u():(r.context.translate(r.context.canvas.width,0),r.context.scale(-1,1),r.scanContext(e,n).finally(function(){u()}))}).catch(function(t){r.logger.logError("Error happend while scanning context",t),u()})}},t.prototype.createVideoConstraints=function(t){if("string"==typeof t)return{deviceId:{exact:t}};if("object"==typeof t){var e="facingMode",n="deviceId",r={user:!0,environment:!0},o="exact",i=function(t){if(t in r)return!0;throw"config has invalid 'facingMode' value = "+"'".concat(t,"'")},a=Object.keys(t);if(1!==a.length)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(a.length," keys");var s=Object.keys(t)[0];if(s!==e&&s!==n)throw"Only '".concat(e,"' and '").concat(n,"' ")+" are supported for 'cameraIdOrConfig'";if(s!==e){var c=t.deviceId;if("string"==typeof c)return{deviceId:c};if("object"==typeof c){if(o in c)return{deviceId:{exact:c["".concat(o)]}};throw"'deviceId' should be string or object with"+" ".concat(o," as key.")}throw"Invalid type of 'deviceId' = ".concat(typeof c)}var l=t.facingMode;if("string"==typeof l){if(i(l))return{facingMode:l}}else{if("object"!=typeof l)throw"Invalid type of 'facingMode' = ".concat(typeof l);if(!(o in l))throw"'facingMode' should be string or object with"+" ".concat(o," as key.");if(i(l["".concat(o)]))return{facingMode:{exact:l["".concat(o)]}}}}throw"Invalid type of 'cameraIdOrConfig' = ".concat(typeof t)},t.prototype.computeCanvasDrawConfig=function(t,e,n,r){if(t<=n&&e<=r)return{x:(n-t)/2,y:(r-e)/2,width:t,height:e};var o=t,i=e;return t>n&&(e*=n/t,t=n),e>r&&(t*=r/e,e=r),this.logger.log("Image downsampled from "+"".concat(o,"X").concat(i)+" to ".concat(t,"X").concat(e,".")),this.computeCanvasDrawConfig(t,e,n,r)},t.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var t=document.getElementById(this.elementId);t&&(t.innerHTML="")},t.prototype.possiblyUpdateShaders=function(t){this.qrMatch!==t&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(e){e.style.backgroundColor=t?Constants.BORDER_SHADER_MATCH_COLOR:Constants.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=t)},t.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},t.prototype.createCanvasElement=function(t,e,n){var r=t,o=e,i=document.createElement("canvas");return i.style.width="".concat(r,"px"),i.style.height="".concat(o,"px"),i.style.display="none",i.id=isNullOrUndefined(n)?"qr-canvas":n,i},t.prototype.getShadedRegionBounds=function(t,e,n){if(n.width>t||n.height>e)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(t-n.width)/2,y:(e-n.height)/2,width:n.width,height:n.height}},t.prototype.possiblyInsertShadingElement=function(t,e,n,r){if(!(e-r.width<1||n-r.height<1)){var o=document.createElement("div");o.style.position="absolute";var i=(e-r.width)/2,a=(n-r.height)/2;if(o.style.borderLeft="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderRight="".concat(i,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderTop="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.borderBottom="".concat(a,"px solid rgba(0, 0, 0, 0.48)"),o.style.boxSizing="border-box",o.style.top="0px",o.style.bottom="0px",o.style.left="0px",o.style.right="0px",o.id="".concat(Constants.SHADED_REGION_ELEMENT_ID),e-r.width<11||n-r.height<11)this.hasBorderShaders=!1;else{var s=40;this.insertShaderBorders(o,s,5,-5,null,0,!0),this.insertShaderBorders(o,s,5,-5,null,0,!1),this.insertShaderBorders(o,s,5,null,-5,0,!0),this.insertShaderBorders(o,s,5,null,-5,0,!1),this.insertShaderBorders(o,5,45,-5,null,-5,!0),this.insertShaderBorders(o,5,45,null,-5,-5,!0),this.insertShaderBorders(o,5,45,-5,null,-5,!1),this.insertShaderBorders(o,5,45,null,-5,-5,!1),this.hasBorderShaders=!0}t.append(o)}},t.prototype.insertShaderBorders=function(t,e,n,r,o,i,a){var s=document.createElement("div");s.style.position="absolute",s.style.backgroundColor=Constants.BORDER_SHADER_DEFAULT_COLOR,s.style.width="".concat(e,"px"),s.style.height="".concat(n,"px"),null!==r&&(s.style.top="".concat(r,"px")),null!==o&&(s.style.bottom="".concat(o,"px")),a?s.style.left="".concat(i,"px"):s.style.right="".concat(i,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(s),t.appendChild(s)},t.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},t.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},t.prototype.getTimeoutFps=function(t){return 1e3/t},t}(),Html5QrcodeScannerStatus;function add_css$2(){var t=element("style");t.id="svelte-9062r9-style",t.textContent="main.svelte-9062r9{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:20px;max-height:400px}reader.svelte-9062r9{width:400px;height:300px;background-color:gray}",append(document.head,t)}function get_each_context$2(t,e,n){const r=t.slice();return r[19]=e[n].id,r[20]=e[n].label,r}function create_if_block$2(t){let e,n,r=t[1]&&create_if_block_1$2(t);return{c(){r&&r.c(),e=space(),n=element("reader"),attr(n,"id","reader"),attr(n,"class","svelte-9062r9")},m(t,o){r&&r.m(t,o),insert(t,e,o),insert(t,n,o)},p(t,n){t[1]?r?r.p(t,n):(r=create_if_block_1$2(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},d(t){r&&r.d(t),t&&detach(e),t&&detach(n)}}}function create_if_block_1$2(t){let e,n,r,o,i,a,s=t[1],c=[];for(let e=0;e<s.length;e+=1)c[e]=create_each_block$2(get_each_context$2(t,s,e));return{c(){e=element("div"),n=text("Quelle:\n "),r=element("select");for(let t=0;t<c.length;t+=1)c[t].c();r.disabled=o=1===t[1].length},m(o,s){insert(o,e,s),append(e,n),append(e,r);for(let t=0;t<c.length;t+=1)c[t].m(r,null);i||(a=listen(r,"change",t[4]),i=!0)},p(t,e){if(6&e){let n;for(s=t[1],n=0;n<s.length;n+=1){const o=get_each_context$2(t,s,n);c[n]?c[n].p(o,e):(c[n]=create_each_block$2(o),c[n].c(),c[n].m(r,null))}for(;n<c.length;n+=1)c[n].d(1);c.length=s.length}2&e&&o!==(o=1===t[1].length)&&(r.disabled=o)},d(t){t&&detach(e),destroy_each(c,t),i=!1,a()}}}function create_each_block$2(t){let e,n,r,o,i=t[20]+"";return{c(){e=element("option"),n=text(i),e.__value=r=t[19],e.value=e.__value,e.selected=o=t[2]===t[19]},m(t,r){insert(t,e,r),append(e,n)},p(t,a){2&a&&i!==(i=t[20]+"")&&set_data(n,i),2&a&&r!==(r=t[19])&&(e.__value=r,e.value=e.__value),6&a&&o!==(o=t[2]===t[19])&&(e.selected=o)},d(t){t&&detach(e)}}}function create_fragment$3(t){let e,n=!t[0]&&create_if_block$2(t);return{c(){e=element("main"),n&&n.c(),attr(e,"class","svelte-9062r9")},m(t,r){insert(t,e,r),n&&n.m(e,null)},p(t,[r]){t[0]?n&&(n.d(1),n=null):n?n.p(t,r):(n=create_if_block$2(t),n.c(),n.m(e,null))},i:noop,o:noop,d(t){t&&detach(e),n&&n.d()}}}!function(t){t[t.STATUS_DEFAULT=0]="STATUS_DEFAULT",t[t.STATUS_SUCCESS=1]="STATUS_SUCCESS",t[t.STATUS_WARNING=2]="STATUS_WARNING",t[t.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"}(Html5QrcodeScannerStatus||(Html5QrcodeScannerStatus={}));const getCameras$1=()=>Html5Qrcode.getCameras();function instance$3(t,e,n){let r;const o=createEventDispatcher(),{loggedIn:i}=user;component_subscribe(t,i,t=>n(9,r=t));let a,s,c,{keyboard:l}=e,{codeTypes:d=""}=e,{readerInit:u=!1}=e,h=!1;const m=r.tenant+"-ENABLERR-CAMERA";onMount(function(){if(l)return void(h=!0);try{a||(a=new Html5Qrcode("reader"));const t=window.localStorage.getItem(m);getCameras$1().then(e=>{if(!e?.length)return;n(1,s=e);const r=e.find(e=>e.id===t);r&&window.localStorage.setItem(m,r.id),p(r?.id||s[0].id)})}catch{}}),onDestroy(function(){_(),o("exit")});var f=function(t,e){var n=250,r=t>e?e:t,o=Math.floor(.75*r);return o<n?r<n?{width:r,height:r}:{width:n,height:n}:{width:o,height:o}};function p(t){if(t&&n(2,c=t),c)try{a.start(c,{fps:5,qrbox:f,formatsToSupport:d||void 0,facingMode:"environment"},g),h=!0}catch{}}async function _(t=!1){try{l||(await a.stop(),t&&await a.clear())}catch{}finally{h=!1}}function g(t,e){h&&(o("scan",{text:t}),h=!1)}return t.$$set=t=>{"keyboard"in t&&n(0,l=t.keyboard),"codeTypes"in t&&n(6,d=t.codeTypes),"readerInit"in t&&n(5,u=t.readerInit)},t.$$.update=()=>{32&t.$$.dirty&&u&&(h=!0,n(5,u=!1))},[l,s,c,i,async t=>{const e=t.target.value;await _(),window.localStorage.setItem(m,e),p(e)},u,d]}class InputReader extends SvelteComponent{constructor(t){super(),document.getElementById("svelte-9062r9-style")||add_css$2(),init(this,t,instance$3,create_fragment$3,safe_not_equal,{keyboard:0,codeTypes:6,readerInit:5})}}const{document:document_1$1}=globals;function add_css$1(){var t=element("style");t.id="svelte-9vv5ub-style",t.textContent=".accordion.svelte-9vv5ub{display:flex;overflow:hidden}.accordion-content.svelte-9vv5ub{position:relative}.formList .accordion > .btn{display:inline-block;margin-bottom:1em;background-color:#F5F5F5}.sTask .formList .accordion > .btn{width:95% !important}.sEmbedded .formList .accordion > .btn{width:97%}@media screen and (max-width: 600px){.formList .accordion > .btn{width:25em}}span.pointer.svelte-9vv5ub{padding-top:1em}div.delete.svelte-9vv5ub{text-decoration:line-through}.icon.svelte-9vv5ub{margin-right:-0.75em}.form-field .formField_italic{font-style:italic}.panel.invalid .btn{border:1px #b80000 solid}.draggableListItem.svelte-9vv5ub{cursor:drag}.draggableListItem.is-active-top.svelte-9vv5ub{border-top:3px purple solid;padding-top:2em}.draggableListItem.is-active-bottom.svelte-9vv5ub{border-bottom:3px purple solid;padding-bottom:2em}.modal-overlay > .dialog.reader{margin-top:0}",append(document_1$1.head,t)}function get_each_context$1(t,e,n){const r=t.slice();return r[143]=e[n],r[145]=n,r}function get_each_context_1$1(t,e,n){const r=t.slice();return r[147]=e[n],r[149]=n,r}function get_each_context_3(t,e,n){const r=t.slice();return r[156]=e[n],r}function get_each_context_2$1(t,e,n){const r=t.slice();return r[151]=e[n].title,r[152]=e[n].toDelete,r[153]=e[n].icon,r}function create_catch_block$1(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block$1(t){let e,n,r,o,i,a,s,c,l,d,u,h=(!t[2]||t[15]?.length&&t[15].length>1)&&create_if_block_14$1(t),m=t[19]&&create_if_block_13$1(t),f=!1!==t[4].transfer&&t[49]?.length&&create_if_block_12$1(t),p=!t[10]&&t[45]&&t[14]&&0!=t[14]&&create_if_block_11$1(t),_=!t[10]&&t[43]&&t[17]&&0!=t[17]&&create_if_block_10$1(t),g=t[41]&&t[13]&&0!=t[13]&&create_if_block_9$1(t);c=new t[36]({props:{class:t[6]+t[4].name,$$slots:{default:[create_default_slot_4$1,({closeOtherPanels:t})=>({146:t}),({closeOtherPanels:t})=>[0,0,0,0,t?4194304:0]]},$$scope:{ctx:t}}});let w=t[19]&&t[22]&&create_if_block$1(t);return{c(){h&&h.c(),e=space(),n=element("div"),m&&m.c(),r=space(),f&&f.c(),o=space(),p&&p.c(),i=space(),_&&_.c(),a=space(),g&&g.c(),s=space(),create_component(c.$$.fragment),l=space(),w&&w.c(),d=empty(),attr(n,"class","formList")},m(t,$){h&&h.m(t,$),insert(t,e,$),insert(t,n,$),m&&m.m(n,null),append(n,r),f&&f.m(n,null),append(n,o),p&&p.m(n,null),append(n,i),_&&_.m(n,null),append(n,a),g&&g.m(n,null),append(n,s),mount_component(c,n,null),insert(t,l,$),w&&w.m(t,$),insert(t,d,$),u=!0},p(t,l){!t[2]||t[15]?.length&&t[15].length>1?h?(h.p(t,l),32772&l[0]&&transition_in(h,1)):(h=create_if_block_14$1(t),h.c(),transition_in(h,1),h.m(e.parentNode,e)):h&&(group_outros(),transition_out(h,1,1,()=>{h=null}),check_outros()),t[19]?m?(m.p(t,l),524288&l[0]&&transition_in(m,1)):(m=create_if_block_13$1(t),m.c(),transition_in(m,1),m.m(n,r)):m&&(group_outros(),transition_out(m,1,1,()=>{m=null}),check_outros()),!1!==t[4].transfer&&t[49]?.length?f?(f.p(t,l),16&l[0]&&transition_in(f,1)):(f=create_if_block_12$1(t),f.c(),transition_in(f,1),f.m(n,o)):f&&(group_outros(),transition_out(f,1,1,()=>{f=null}),check_outros()),!t[10]&&t[45]&&t[14]&&0!=t[14]?p?(p.p(t,l),17408&l[0]&&transition_in(p,1)):(p=create_if_block_11$1(t),p.c(),transition_in(p,1),p.m(n,i)):p&&(group_outros(),transition_out(p,1,1,()=>{p=null}),check_outros()),!t[10]&&t[43]&&t[17]&&0!=t[17]?_?(_.p(t,l),132096&l[0]&&transition_in(_,1)):(_=create_if_block_10$1(t),_.c(),transition_in(_,1),_.m(n,a)):_&&(group_outros(),transition_out(_,1,1,()=>{_=null}),check_outros()),t[41]&&t[13]&&0!=t[13]?g?(g.p(t,l),8192&l[0]&&transition_in(g,1)):(g=create_if_block_9$1(t),g.c(),transition_in(g,1),g.m(n,s)):g&&(group_outros(),transition_out(g,1,1,()=>{g=null}),check_outros());const u={};80&l[0]&&(u.class=t[6]+t[4].name),1612554239&l[0]|1&l[1]|4194304&l[4]|16&l[5]&&(u.$$scope={dirty:l,ctx:t}),c.$set(u),t[19]&&t[22]?w?(w.p(t,l),4718592&l[0]&&transition_in(w,1)):(w=create_if_block$1(t),w.c(),transition_in(w,1),w.m(d.parentNode,d)):w&&(group_outros(),transition_out(w,1,1,()=>{w=null}),check_outros())},i(t){u||(transition_in(h),transition_in(m),transition_in(f),transition_in(p),transition_in(_),transition_in(g),transition_in(c.$$.fragment,t),transition_in(w),u=!0)},o(t){transition_out(h),transition_out(m),transition_out(f),transition_out(p),transition_out(_),transition_out(g),transition_out(c.$$.fragment,t),transition_out(w),u=!1},d(t){h&&h.d(t),t&&detach(e),t&&detach(n),m&&m.d(),f&&f.d(),p&&p.d(),_&&_.d(),g&&g.d(),destroy_component(c),t&&detach(l),w&&w.d(t),t&&detach(d)}}}function create_if_block_14$1(t){let e,n;return e=new t[38]({props:{text:t[4].designation}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16&n[0]&&(r.text=t[4].designation),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_13$1(t){let e,n;return e=new t[35]({props:{disabled:t[1]||!t[0]._id&&t[21].input,filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_11$1]},$$scope:{ctx:t}}}),e.$on("click",t[70]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2097155&n[0]&&(r.disabled=t[1]||!t[0]._id&&t[21].input),16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_11$1(t){let e,n,r;return n=new CameraIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Barcode scannen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_12$1(t){let e,n;return e=new t[35]({props:{filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_10$1]},$$scope:{ctx:t}}}),e.$on("click",t[77]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_10$1(t){let e,n,r,o,i=t[69](t[4].transfer)+"";return r=new ArrowDownCircleIcon({props:{size:"18"}}),{c(){e=element("span"),n=text(i),create_component(r.$$.fragment),set_style(e,"margin-right",".75em")},m(t,i){insert(t,e,i),append(e,n),mount_component(r,t,i),o=!0},p(t,e){(!o||16&e[0])&&i!==(i=t[69](t[4].transfer)+"")&&set_data(n,i)},i(t){o||(transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(r.$$.fragment,t),o=!1},d(t){t&&detach(e),destroy_component(r,t)}}}function create_if_block_11$1(t){let e,n;return e=new t[34]({props:{name:"Total Wochen",nameClass:"formField_italic",$$slots:{default:[create_default_slot_9$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};16384&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_9$1(t){let e,n,r;function o(e){t[83](e)}let i={item:t[46],disabled:!0};return void 0!==t[14]&&(i.value=t[14]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};!n&&16384&r[0]&&(n=!0,o.value=t[14],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_10$1(t){let e,n;return e=new t[34]({props:{name:"Total Stunden",nameClass:"formField_italic",$$slots:{default:[create_default_slot_8$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};131072&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_8$1(t){let e,n,r;function o(e){t[84](e)}let i={item:t[44],disabled:!0};return void 0!==t[17]&&(i.value=t[17]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};!n&&131072&r[0]&&(n=!0,o.value=t[17],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_9$1(t){let e,n;return e=new t[34]({props:{name:"Total Betrag",nameClass:"formField_italic",$$slots:{default:[create_default_slot_7$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};8448&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_7$1(t){let e,n,r;function o(e){t[85](e)}let i={item:t[42],disabled:!0,currency:t[8]};return void 0!==t[13]&&(i.value=t[13]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};256&r[0]&&(o.currency=t[8]),!n&&8192&r[0]&&(n=!0,o.value=t[13],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_6$1(t){let e,n;return e=new t[37]({props:{class:t[29][t[149]],open:t[12]&&!t[2]&&0===t[149]&&!t[19],$$slots:{handle:[create_handle_slot,({toggle:t,open:e})=>({150:t,12:e}),({toggle:t,open:e})=>[e?4096:0,0,0,0,t?67108864:0]],default:[create_default_slot_6$1,({toggle:t,open:e})=>({150:t,12:e}),({toggle:t,open:e})=>[e?4096:0,0,0,0,t?67108864:0]]},$$scope:{ctx:t}}}),e.$on("panel-open",function(){is_function(t[66](t[149],t[146]))&&t[66](t[149],t[146]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};536870912&r[0]&&(o.class=t[29][t[149]]),528388&r[0]&&(o.open=t[12]&&!t[2]&&0===t[149]&&!t[19]),1075159035&r[0]|1&r[1]|67108864&r[4]|16&r[5]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_3(t){let e,n;return e=new InputFormField({props:{praefix:t[149],item:t[156],eventId:t[7],fullRecord:t[0],record:t[147],recordId:t[0]._id,multiValues:t[5],reqQuantity:t[3],notifyList:t[9],noForm:noForm,classId:t[6],disabled:t[1],required:t[40],selectionFields:t[50],propSelection:t[20],numberInput:t[31],dateInput:{...t[11],l:t[4].name,t:t[149]===t[15].length-1,n:t[48].get(t[156].name)},shortEdit:t[10],currency:t[8],initFinished:t[18],formnovalidate:t[149]===t[15].length-1||t[15][t[149]]._delete}}),e.$on("notify",function(){is_function(t[54](t[4],t[156],t[149]))&&t[54](t[4],t[156],t[149]).apply(this,arguments)}),e.$on("task",function(){is_function(t[53](t[4]))&&t[53](t[4]).apply(this,arguments)}),e.$on("invalid",t[55]),e.$on("defPrep",t[56]),e.$on("checkRange",t[57]),e.$on("formula",t[67](t[149])),e.$on("record",t[86]),e.$on("listRecord",t[58](t[149])),e.$on("propSelection",t[68](t[149])),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};16&r[0]&&(o.item=t[156]),128&r[0]&&(o.eventId=t[7]),1&r[0]&&(o.fullRecord=t[0]),32768&r[0]&&(o.record=t[147]),1&r[0]&&(o.recordId=t[0]._id),32&r[0]&&(o.multiValues=t[5]),8&r[0]&&(o.reqQuantity=t[3]),512&r[0]&&(o.notifyList=t[9]),64&r[0]&&(o.classId=t[6]),2&r[0]&&(o.disabled=t[1]),1048576&r[0]&&(o.propSelection=t[20]),1&r[1]&&(o.numberInput=t[31]),34832&r[0]&&(o.dateInput={...t[11],l:t[4].name,t:t[149]===t[15].length-1,n:t[48].get(t[156].name)}),1024&r[0]&&(o.shortEdit=t[10]),256&r[0]&&(o.currency=t[8]),262144&r[0]&&(o.initFinished=t[18]),32768&r[0]&&(o.formnovalidate=t[149]===t[15].length-1||t[15][t[149]]._delete),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_key_block_1(t){let e,n,r=t[4].item,o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_3(get_each_context_3(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(1347579&n[0]|264897025&n[1]|96&n[2]){let a;for(r=t[4].item,a=0;a<r.length;a+=1){const i=get_each_context_3(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block_3(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_key_block(t){let e,n,r=t[15][t[149]]._delete,o=create_key_block_1(t);return{c(){o.c(),e=empty()},m(t,r){o.m(t,r),insert(t,e,r),n=!0},p(t,n){32768&n[0]&&safe_not_equal(r,r=t[15][t[149]]._delete)?(group_outros(),transition_out(o,1,1,noop),check_outros(),o=create_key_block_1(t),o.c(),transition_in(o),o.m(e.parentNode,e)):o.p(t,n)},i(t){n||(transition_in(o),n=!0)},o(t){transition_out(o),n=!1},d(t){t&&detach(e),o.d(t)}}}function create_default_slot_6$1(t){let e,n,r,o,i=t[15].length,a=create_key_block(t);return{c(){e=element("div"),a.c(),r=space(),attr(e,"id",n=`accordion-content-${t[6]}-${t[4].name}-${t[149]}`)},m(t,n){insert(t,e,n),a.m(e,null),insert(t,r,n),o=!0},p(t,r){32768&r[0]&&safe_not_equal(i,i=t[15].length)?(group_outros(),transition_out(a,1,1,noop),check_outros(),a=create_key_block(t),a.c(),transition_in(a),a.m(e,null)):a.p(t,r),(!o||80&r[0]&&n!==(n=`accordion-content-${t[6]}-${t[4].name}-${t[149]}`))&&attr(e,"id",n)},i(t){o||(transition_in(a),o=!0)},o(t){transition_out(a),o=!1},d(t){t&&detach(e),a.d(t),t&&detach(r)}}}function create_if_block_8$1(t){let e,n;return e=new t[35]({props:{$$slots:{default:[create_default_slot_5$1]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[59](t[150],t[149],t[12]))&&t[59](t[150],t[149],t[12]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};1073840144&r[0]|16&r[5]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_5$1(t){let e,n,r,o,i,a=t[52](t[16],t[149])+"";return{c(){e=element("div"),n=text(a),attr(e,"class",r=null_to_empty("draggableListItem "+t[4].name)+" svelte-9vv5ub"),attr(e,"draggable",!0),toggle_class(e,"delete",t[147]._delete),toggle_class(e,"is-active-top",t[30]?.top===t[149]),toggle_class(e,"is-active-bottom",t[30]?.bottom===t[149])},m(r,a){insert(r,e,a),append(e,n),o||(i=[listen(e,"dragover",t[64]),listen(e,"dragleave",t[65](t[149])),listen(e,"dragstart",t[62](t[149])),listen(e,"drop",prevent_default(t[61](t[149]))),listen(e,"dragenter",t[63](t[149]))],o=!0)},p(o,i){t=o,65536&i[0]&&a!==(a=t[52](t[16],t[149])+"")&&set_data(n,a),16&i[0]&&r!==(r=null_to_empty("draggableListItem "+t[4].name)+" svelte-9vv5ub")&&attr(e,"class",r),32784&i[0]&&toggle_class(e,"delete",t[147]._delete),1073741840&i[0]&&toggle_class(e,"is-active-top",t[30]?.top===t[149]),1073741840&i[0]&&toggle_class(e,"is-active-bottom",t[30]?.bottom===t[149])},d(t){t&&detach(e),o=!1,run_all(i)}}}function create_if_block_7$1(t){let e,n,r;var o=t[153];return o&&(e=new o({props:{size:"20"}})),{c(){e&&create_component(e.$$.fragment),n=empty()},m(t,o){e&&mount_component(e,t,o),insert(t,n,o),r=!0},p(t,r){if(o!==(o=t[153])){if(e){group_outros();const t=e;transition_out(t.$$.fragment,1,0,()=>{destroy_component(t,1)}),check_outros()}o?(e=new o({props:{size:"20"}}),create_component(e.$$.fragment),transition_in(e.$$.fragment,1),mount_component(e,n.parentNode,n)):e=null}},i(t){r||(e&&transition_in(e.$$.fragment,t),r=!0)},o(t){e&&transition_out(e.$$.fragment,t),r=!1},d(t){t&&detach(n),e&&destroy_component(e,t)}}}function create_each_block_2$1(t){let e,n,r,o,i,a=!t[1]&&!t[4].readonly&&create_if_block_7$1(t);return{c(){e=element("span"),a&&a.c(),attr(e,"class","pointer icon svelte-9vv5ub"),attr(e,"title",t[151]),e.hidden=n=t[149]===t[15].length-1||!(t[147]._delete^t[152])},m(n,s){insert(n,e,s),a&&a.m(e,null),r=!0,o||(i=listen(e,"click",function(){is_function(t[60](t[149],t[12],t[150]))&&t[60](t[149],t[12],t[150]).apply(this,arguments)}),o=!0)},p(o,i){(t=o)[1]||t[4].readonly?a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()):a?(a.p(t,i),18&i[0]&&transition_in(a,1)):(a=create_if_block_7$1(t),a.c(),transition_in(a,1),a.m(e,null)),(!r||32768&i[0]&&n!==(n=t[149]===t[15].length-1||!(t[147]._delete^t[152])))&&(e.hidden=n)},i(t){r||(transition_in(a),r=!0)},o(t){transition_out(a),r=!1},d(t){t&&detach(e),a&&a.d(),o=!1,i()}}}function create_handle_slot(t){let e,n,r,o,i,a=!t[10]&&create_if_block_8$1(t),s=[{title:"löschen",toDelete:!0,icon:DeleteIcon},{title:"undo",toDelete:!1,icon:CornerDownLeftIcon}],c=[];for(let e=0;e<2;e+=1)c[e]=create_each_block_2$1(get_each_context_2$1(t,s,e));const l=t=>transition_out(c[t],1,1,()=>{c[t]=null});return{c(){e=element("div"),a&&a.c(),n=space();for(let t=0;t<2;t+=1)c[t].c();r=space(),attr(e,"class",o=null_to_empty("accordion "+t[4].name)+" svelte-9vv5ub"),attr(e,"slot","handle")},m(t,o){insert(t,e,o),a&&a.m(e,null),append(e,n);for(let t=0;t<2;t+=1)c[t].m(e,null);append(e,r),i=!0},p(t,d){if(t[10]?a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()):a?(a.p(t,d),1024&d[0]&&transition_in(a,1)):(a=create_if_block_8$1(t),a.c(),transition_in(a,1),a.m(e,n)),36882&d[0]|536870912&d[1]|67108864&d[4]){let n;for(s=[{title:"löschen",toDelete:!0,icon:DeleteIcon},{title:"undo",toDelete:!1,icon:CornerDownLeftIcon}],n=0;n<2;n+=1){const o=get_each_context_2$1(t,s,n);c[n]?(c[n].p(o,d),transition_in(c[n],1)):(c[n]=create_each_block_2$1(o),c[n].c(),transition_in(c[n],1),c[n].m(e,r))}for(group_outros(),n=2;n<2;n+=1)l(n);check_outros()}(!i||16&d[0]&&o!==(o=null_to_empty("accordion "+t[4].name)+" svelte-9vv5ub"))&&attr(e,"class",o)},i(t){if(!i){transition_in(a);for(let t=0;t<2;t+=1)transition_in(c[t]);i=!0}},o(t){transition_out(a),c=c.filter(Boolean);for(let t=0;t<2;t+=1)transition_out(c[t]);i=!1},d(t){t&&detach(e),a&&a.d(),destroy_each(c,t)}}}function create_each_block_1$1(t){let e,n,r=(!t[2]&&!t[1]||t[149]<t[15].length-1)&&create_if_block_6$1(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){!t[2]&&!t[1]||t[149]<t[15].length-1?r?(r.p(t,n),32774&n[0]&&transition_in(r,1)):(r=create_if_block_6$1(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_default_slot_4$1(t){let e,n,r=t[15],o=[];for(let e=0;e<r.length;e+=1)o[e]=create_each_block_1$1(get_each_context_1$1(t,r,e));const i=t=>transition_out(o[t],1,1,()=>{o[t]=null});return{c(){for(let t=0;t<o.length;t+=1)o[t].c();e=empty()},m(t,r){for(let e=0;e<o.length;e+=1)o[e].m(t,r);insert(t,e,r),n=!0},p(t,n){if(1612554239&n[0]|2146042369&n[1]|127&n[2]|71303168&n[4]){let a;for(r=t[15],a=0;a<r.length;a+=1){const i=get_each_context_1$1(t,r,a);o[a]?(o[a].p(i,n),transition_in(o[a],1)):(o[a]=create_each_block_1$1(i),o[a].c(),transition_in(o[a],1),o[a].m(e.parentNode,e))}for(group_outros(),a=r.length;a<o.length;a+=1)i(a);check_outros()}},i(t){if(!n){for(let t=0;t<r.length;t+=1)transition_in(o[t]);n=!0}},o(t){o=o.filter(Boolean);for(let t=0;t<o.length;t+=1)transition_out(o[t]);n=!1},d(t){destroy_each(o,t),t&&detach(e)}}}function create_if_block$1(t){let e,n,r;function o(e){t[88](e)}let i={$$slots:{default:[create_default_slot$2,({closeCallback:t})=>({142:t}),({closeCallback:t})=>[0,0,0,0,t?262144:0]]},$$scope:{ctx:t}};return void 0!==t[22]&&(i.open=t[22]),e=new t[32]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};529006592&r[0]|262144&r[4]|16&r[5]&&(o.$$scope={dirty:r,ctx:t}),!n&&4194304&r[0]&&(n=!0,o.open=t[22],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_else_block_1$1(t){let e,n;return{c(){e=element("td"),n=text(t[24])},m(t,r){insert(t,e,r),append(e,n)},p(t,e){16777216&e[0]&&set_data(n,t[24])},d(t){t&&detach(e)}}}function create_if_block_5$1(t){let e,n,r,o;return{c(){e=element("td"),n=element("input"),attr(n,"id","reader_focusId"),n.autofocus=!0,n.value=t[23]},m(i,a){insert(i,e,a),append(e,n),n.focus(),r||(o=[listen(n,"focus",t[72]),listen(n,"input",function(){is_function(t[78](t[19].keyboard.length))&&t[78](t[19].keyboard.length).apply(this,arguments)})],r=!0)},p(e,r){t=e,8388608&r[0]&&n.value!==t[23]&&(n.value=t[23])},d(t){t&&detach(e),r=!1,run_all(o)}}}function create_if_block_4$1(t){let e,n,r,o,i,a=t[73](t[19].refItem,!0)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" nicht gefunden!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){524288&e[0]&&a!==(a=t[73](t[19].refItem,!0)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_3$1(t){let e,n,r,o,i,a=t[73](t[19].refItem)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" bereits eingefügt!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){524288&e[0]&&a!==(a=t[73](t[19].refItem)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_1$1(t){let e;let n=function(t){return"number"===t[143].type?create_if_block_2$1:create_else_block$1}(t),r=n(t);return{c(){r.c(),e=empty()},m(t,n){r.m(t,n),insert(t,e,n)},p(t,e){r.p(t,e)},d(t){r.d(t),t&&detach(e)}}}function create_else_block$1(t){let e;return{c(){e=element("input"),attr(e,"id","reader_"+t[143].name),attr(e,"type","text")},m(t,n){insert(t,e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block_2$1(t){let e,n,r;return{c(){e=element("input"),set_style(e,"width","4em"),attr(e,"id","reader_"+t[143].name),attr(e,"type","number"),attr(e,"min","0")},m(o,i){insert(o,e,i),n||(r=listen(e,"input",function(){is_function(t[78](t[19].keyboard.length,t[143]))&&t[78](t[19].keyboard.length,t[143]).apply(this,arguments)}),n=!0)},p(e,n){t=e},d(t){t&&detach(e),n=!1,r()}}}function create_each_block$1(t){let e,n,r,o,i,a,s=t[73](t[143].name)+"",c=t[25]&&create_if_block_1$1(t);return{c(){e=element("tr"),n=element("th"),r=text(s),o=space(),i=element("td"),c&&c.c(),a=space()},m(t,s){insert(t,e,s),append(e,n),append(n,r),append(e,o),append(e,i),c&&c.m(i,null),append(e,a)},p(t,e){t[25]?c?c.p(t,e):(c=create_if_block_1$1(t),c.c(),c.m(i,null)):c&&(c.d(1),c=null)},d(t){t&&detach(e),c&&c.d()}}}function create_default_slot_3$1(t){let e;return{c(){e=text("Verwerfen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_2$1(t){let e;return{c(){e=text("Speichern")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_1$1(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$,y,b,v,I,C=t[73](t[19].refItem)+"";function E(e){t[87](e)}let A={keyboard:t[19].keyboard,codeTypes:t[19].codeTypes};function S(t,e){return t[19].keyboard?create_if_block_5$1:create_else_block_1$1}void 0!==t[27]&&(A.readerInit=t[27]),e=new InputReader({props:A}),binding_callbacks.push(()=>bind(e,"readerInit",E)),e.$on("scan",t[71]),e.$on("exit",t[76]);let k=S(t),T=k(t);function R(t,e){return t[28]?create_if_block_3$1:t[24]&&!t[26]?create_if_block_4$1:void 0}let N=R(t),D=N&&N(t),x=t[47],O=[];for(let e=0;e<x.length;e+=1)O[e]=create_each_block$1(get_each_context$1(t,x,e));return y=new t[35]({props:{disabled:!t[24],outline:!0,style:"float: left;",$$slots:{default:[create_default_slot_3$1]},$$scope:{ctx:t}}}),y.$on("click",t[74]),v=new t[35]({props:{disabled:!t[26],filled:!0,style:"float: right;",$$slots:{default:[create_default_slot_2$1]},$$scope:{ctx:t}}}),v.$on("click",t[75]),{c(){create_component(e.$$.fragment),r=space(),o=element("div"),i=element("table"),a=element("tr"),s=element("th"),s.textContent="Code",c=space(),T.c(),l=space(),d=element("tr"),u=element("th"),h=text(C),m=space(),f=element("td"),p=element("div"),_=text(t[25]),g=space(),D&&D.c(),w=space();for(let t=0;t<O.length;t+=1)O[t].c();$=space(),create_component(y.$$.fragment),b=space(),create_component(v.$$.fragment),set_style(p,"max-width","14em"),set_style(i,"margin-top","1em"),set_style(i,"margin-bottom","1em"),set_style(i,"text-align","left"),set_style(o,"position","relative"),set_style(o,"z-index","1000"),set_style(o,"background-color","white"),set_style(o,"height","225px")},m(t,n){mount_component(e,t,n),insert(t,r,n),insert(t,o,n),append(o,i),append(i,a),append(a,s),append(a,c),T.m(a,null),append(i,l),append(i,d),append(d,u),append(u,h),append(d,m),append(d,f),append(f,p),append(p,_),append(i,g),D&&D.m(i,null),append(i,w);for(let t=0;t<O.length;t+=1)O[t].m(i,null);append(o,$),mount_component(y,o,null),append(o,b),mount_component(v,o,null),I=!0},p(t,r){const o={};if(524288&r[0]&&(o.keyboard=t[19].keyboard),524288&r[0]&&(o.codeTypes=t[19].codeTypes),!n&&134217728&r[0]&&(n=!0,o.readerInit=t[27],add_flush_callback(()=>n=!1)),e.$set(o),k===(k=S(t))&&T?T.p(t,r):(T.d(1),T=k(t),T&&(T.c(),T.m(a,null))),(!I||524288&r[0])&&C!==(C=t[73](t[19].refItem)+"")&&set_data(h,C),(!I||33554432&r[0])&&set_data(_,t[25]),N===(N=R(t))&&D?D.p(t,r):(D&&D.d(1),D=N&&N(t),D&&(D.c(),D.m(i,w))),34078720&r[0]|65536&r[1]|67584&r[2]){let e;for(x=t[47],e=0;e<x.length;e+=1){const n=get_each_context$1(t,x,e);O[e]?O[e].p(n,r):(O[e]=create_each_block$1(n),O[e].c(),O[e].m(i,null))}for(;e<O.length;e+=1)O[e].d(1);O.length=x.length}const s={};16777216&r[0]&&(s.disabled=!t[24]),16&r[5]&&(s.$$scope={dirty:r,ctx:t}),y.$set(s);const c={};67108864&r[0]&&(c.disabled=!t[26]),16&r[5]&&(c.$$scope={dirty:r,ctx:t}),v.$set(c)},i(t){I||(transition_in(e.$$.fragment,t),transition_in(y.$$.fragment,t),transition_in(v.$$.fragment,t),I=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(y.$$.fragment,t),transition_out(v.$$.fragment,t),I=!1},d(t){destroy_component(e,t),t&&detach(r),t&&detach(o),T.d(),D&&D.d(),destroy_each(O,t),destroy_component(y),destroy_component(v)}}}function create_default_slot$2(t){let e,n;return e=new t[33]({props:{title:"Scannen",class:"reader",closeCallback:t[142],$$slots:{default:[create_default_slot_1$1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};262144&n[4]&&(r.closeCallback=t[142]),529006592&n[0]|16&n[5]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_pending_block$1(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_fragment$2(t){let e,n,r={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block$1,then:create_then_block$1,catch:create_catch_block$1,value:141,blocks:[,,,]};return handle_promise(t[51](),r),{c(){e=empty(),r.block.c()},m(t,o){insert(t,e,o),r.block.m(t,r.anchor=o),r.mount=()=>e.parentNode,r.anchor=e,n=!0},p(e,n){update_await_block_branch(r,t=e,n)},i(t){n||(transition_in(r.block),n=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(r.blocks[t])}n=!1},d(t){t&&detach(e),r.block.d(t),r.token=null,r=null}}}let _praefix=new Map;const setPraefix=(t,e)=>{_praefix.set(e,t)},getPraefix=t=>{const e=_praefix.get(t);return void 0===e?t:e},noForm=!0,dragId="pos/target";function _delay(t){return new Promise(e=>{setTimeout(e,t)})}function instance$2(t,e,n){let r,o,i;const{Modal:a,Dialog:s,FormField:c,TextField:l,Button:d,Accordion:u,AccordionSection:h,Divider:m}=getAttractions,f=createEventDispatcher(),{loggedIn:p}=user;component_subscribe(t,p,t=>n(96,i=t));let{list:_}=e,{mainSchema:g}=e,{schema:w}=e,{record:$}=e,{multiValues:y}=e,{classId:b}=e,{eventId:v}=e,{disabled:I}=e,{fixed:C}=e,{template:E={}}=e,{reqQuantity:A}=e,{open:S=!1}=e,{currency:k}=e,{notifyList:T}=e,{shortEdit:R}=e,{dateInput:N}=e;const D=w.find(t=>"price"===t.name&&!t.properties?.hidden),x=w.find(t=>"amount"===t.name&&!t.properties?.hidden)||w.find(t=>t.isAmount&&!t.properties?.hidden),O=w.find(t=>"quantity"===t.name&&!t.properties?.hidden),M=x||D&&O,P=M&&O;let B=0;const F=w.find(t=>"quantity"===t.name&&"h"===t.properties?.unit?.constant&&!t.properties?.hidden);let L=0;const q=w.find(t=>"number"===t.type&&"w"===t.properties?.unit?.constant?.toLowerCase()&&!t.properties?.hidden)?.name||"",V=!!q;let H=0,U=!1;const z={},W=_.reader;let j,G,X,Q=w.properties?.readonly,Y=b.split("form-")[1].slice(0,-4),Z=new Map,K="",J=!0,tt="",et="",nt="",rt=!1,ot=!1,it=!1;const at=w.filter(t=>t.properties?.reader);let st=new Map;_.group&&(C=!0);const ct={},lt=new Map,dt=_.item.filter(t=>"number"===t.type&&!!t.properties?.transfer);I||=Q;let ut,ht,mt=[],ft=[],pt=!1,_t={},gt=[];const wt=async t=>{if("saleDelivery"!==_.name||!ut?.length||t[_.name]?.length){if(n(3,A=t.quantity),R)n(15,ut=t[_.name]||[]);else if(!t._id&&_.filter){const t=ut;n(15,ut=[]);const e=await Lt();n(15,ut=!1!==e?e.concat({}):t)}else n(15,ut=((t,e)=>{let n=t[e];if(n?.length||(n=[]),n=n.concat({}),t._id)return n;for(const e of w)e.preset&&!n[0][e.name]&&(n[0][e.name]=t[e.preset]);return n})(t,_.name)||[{}]);qt(t)}};w.filter(t=>t.selection).map(t=>mt.push({className:Y,parentClass:w,refClass:t.selection,value:""}));["readonly","hidden","required"].map(t=>{w.filter(e=>"object"==typeof(e.properties&&e.properties[t])).map(e=>{const n=e.properties[t].refItem||"",r=e.properties[t].refValue;let[o,i]=n.split(".");i||(i=o,o=void 0),gt.push({action:t,itemName:e.name,refObj:o,refName:i,refValue:r,op:e.properties[t].invert?"!":""})})});const $t=(t,e=!1)=>{if(!t)return"";try{if(t.split&&3===t.split("-").length)return new Date(t)?.toISOString();if(t.split&&3===t.split(".").length){const[e,n,r]=t.split("."),o=new Date(r,n-1,e);if(!isNaN(o))return o.toISOString()}}catch{}return e?t:""},yt=t=>t.slice(0,3).join(", "),bt=(t,e,o)=>async({detail:i})=>{const{oldValue:a,value:s,add:c}=i;if(a&&!s){const t=w.find(t=>t.refItem===e.refClass&&t._formulaActor);t&&Tt(o,t._formulaActor,!0)}if(s&&e.refClass){const t="p$"+e.refClass+"$"+v;let n=await getList2(t);0===n?.length&&(await _delay(500),n=await getList2(t)),n&&n.find(({_id:t})=>t==s)||await getTaskFull(e.refClass,s)}let{desc:l}=i;if(""===a&&""===s&&(l=""),t.refItem){const r=await Ct(t,o,e,t.refItem);r&&n(15,ut=r)}Tt(o,e._formulaActor);const d=mt?.find(t=>t.refClass.split(":")[1]?.split(".")[0]===e.refClass);d&&(d.value=(d.value||new Map).set(o,s)),s&&ut.length===o+1&&!R&&n(15,ut=ut.concat({})),l&&n(82,z[s]=l,z),R||await Nt(t,o,e,s,a),await At(o,e.name),n(16,r=ut),"number"===e.type&&n(31,_t={item:e,value:s,idx:o}),await vt(o),St(o)},vt=async t=>{if(ut[t]&&!_.filter&&ut.length!==t+1)for(const e of w.filter(t=>!!t.refProp)){let r,o=$[e.refItem]||ut[t][e.refItem];if(!o)continue;if(Array.isArray(o)){if(ut[t][e.name])continue;o=o[t][e.refItem]}const i="p$"+e.refItem+"$"+v;let a=await getList2(i);if(a&&(r=a.find(({_id:t})=>t==o)),r||(r=await getTaskFull(e.refItem,o)),!r)continue;const s=It(r,e.refProp)?.replace(",",".")||r[e.refProp]&&r[e.refProp][e.name]?.replace(",",".")||r[e.refProp];ut[t][e.name]||n(15,ut[t][e.name]=s,ut)}},It=(t,e)=>{try{return t.split(".").reduce((t,e)=>t[e],e)}catch(t){return""}},Ct=async(t,e,n,r)=>{if(t.filter)return;const o=$[r];if(!o?.length)return;const i=o[0][r];if(!i)return;const a=await getTaskFull(r,i);return a?a[t.name]:void 0},Et=(t,e,r,o)=>{if(!t.filter){if(o&&!1===r.refItem){const t="boolean"!==r.type&&"";ut[e][r.name]&&n(15,ut[e][r.name]=t,ut)}ut.length!==e+1&&"number"==typeof r.properties?.value&&n(15,ut[e][r.name]=r.properties.value,ut)}},At=async(t,e)=>{const r=gt.filter(t=>(t.refObj||Y)===e||t.refName===e);if(r?.length)for(const e of r){const{itemName:r,refObj:o,refName:i,refValue:a,op:s}=e;let c,l,{action:d}=e,u=!1,h=!1;if(o){const e=ut[t][o];o===Y&&i?u=$:e&&(u=await getTaskFull(o,e))}!o&&i&&(u=ut[t]),u&&(h=u[i],Array.isArray(h)&&0===h.length?h=!1:a&&(h=h==(u[a]||$[a]))),"!"===s&&(h=!h),"required"!==d&&"readonly"!==d||(d="required"===d?d:"disabled",setTimeout(()=>{c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r} .field textarea`,l=document.querySelector(c),l||(c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r} .field input#${"dp-"+r+"-"+t}`,l=document.querySelector(c)),l||(c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r} .field input`,l=document.querySelector(c)),l&&h&&l.setAttribute(d,""),l&&!h&&l.removeAttribute(d)},0)),"hidden"===d&&(c=`#accordion-content-${b}-${_.name}-${t} .form-field.${r}`,l=document.querySelector(c),l?.classList?.toggle("hidden",h),h&&n(15,ut[t][r]="",ut))}},St=(t,e)=>{let r=`#accordion-content-${b}-${_.name}-${t} .form-field:not(.hidden) .field :required:not(:disabled)`;const o=document.querySelectorAll(r);let i=!1;o.forEach(t=>{!t.id.startsWith("dp-")&&t.required&&""===t.value&&(i=!0)}),void 0===e&&(r=`#accordion-content-${b}-${_.name}-${t} :not(.form-field.hidden) .field input.invalid`,document.querySelector(r)&&(e=!0)),n(29,ft[t]=i||e?"invalid":"",ft)},kt=t=>{if(!t)return 0;const[e,n=0]=t.split(":");return 60*e+parseInt(n)},Tt=(t,e,r=!1)=>{if(!e)return;const o=w.find(t=>t.name===e);if(!o)return;const i=o.properties.value.formula,{operator:a,argument:s}=i,c=s.map(e=>ut[t][e.refItem]||$[e.refItem]);let l=0;if("$preferred"===a)if(r)l="";else{if($._id&&void 0!==ut[t][e])return;l=c.reduce((t,e)=>{let n=t;return"number"===o.type?n=+n||+e:n||=e,n})}if("$add"===a&&(l=c.reduce((t,e)=>+(t||0)+ +(e||0))),"$subtract"===a&&(l=c.reduce((t,e)=>{t||(t=""),e||(e=""),"number"==typeof t&&(t=t.toString());const[n,r]=t.split(":");t=r?(+n+ +r/60).toFixed(2):+(n||0);let[o,i]=e.split(":");return o||(o=0),t-=i?(+o+ +i/60).toFixed(2):+(o||0)})),"$multiply"===a&&(l=c.reduce((t,e)=>+(t||0)*+(e||0))),"$percentMultiply"===a){const[t,e]=c;l=+t,+e>0&&(l*=1-e/100)}if("$percentDivide"===a){const[t,e]=c;0!=+e&&(l=+t/+e*100)}if("$percentSubtract"===a){let[t,e]=c;e.replace&&(e=e.replace(",",".")),0!=+e&&(l=+t-t*+e/100)}const d=`#accordion-content-${b}-${_.name}-${t} .form-field.${e} .field input`,u=document.querySelector(d),h=u?.disabled;n(15,ut[t][e]="$multiply"===a?l?Rt(l,o.properties?.decimals):"":Rt(l,o.properties?.decimals),ut),n(31,_t={item:o,value:l,idx:t}),setTimeout(()=>{const e=document.querySelector(d);h&&e&&e.setAttribute("disabled",""),o._formulaActor&&Tt(t,o._formulaActor)},0)},Rt=(t,e)=>("number"==typeof t&&t||(t=Number(t||0)),t.toFixed(e||0));ht=w.filter(t=>t.refClass).reduce((t,e)=>{const n=w.filter(t=>t.refItem===e.refClass);if(!n?.length)return t;if(e.selection){const[n,r]=e.selection.split(":"),[o]=r?.split(".")||[];o&&t.push({refClass:o,items:[n],selection:e.selection})}const r={refClass:e.refClass,items:[]};return n.forEach(t=>{r.items.push(t.name)}),t.push(r),t},[]);const Nt=async(t,e,r,o,i)=>{if(t.filter)return;const a=(await ht).find(t=>t.refClass===r.refClass);if(!a)return;const{refClass:s,items:c,selection:l}=a,d=r.name;if(gt.find(t=>t.itemName===d)){const n=`#accordion-content-${b}-${t.name}-${e} .form-field.${s}.hidden`;if(document.querySelector(n))return}return o?Promise.all(c.map(async t=>{let a=w.find(e=>e.name===t);if(!a)return;let d=a.refName||a.name,u="",h="";if(a.lookup){if(h=ut[e][a.name],n(15,ut[e][a.name]="",ut),!ut[e][a.refItem])return void n(15,ut[e][a.name]="",ut);let[t,r,o]=a.lookup.split(".");o||(o=r,r="");const i=a.lookupRefItem||a.refItem,s=a.lookupRefName||d,c="p$"+a.refItem+"$"+v;let l,m=await getList2(c);if(l=m?.find(({_id:t})=>t==ut[e][a.refItem]),l||(l=await getTaskFull(a.refItem,ut[e][a.refItem])),l){if(a.refItem2){const t=await getTaskFull(a.refItem2,l[a.refItem2]);if("dealerPrice"===d&&$.branch){const t=await getTaskFull("branch",$.branch);t?.sector?.includes("Privat")&&(d="price")}t&&(u=t[d])}0===+u&&(u=l[d])}if($[t]){const n=await getTaskFull(t,$[t]);if(n&&n[r]){const t=await getTaskFull(r,n[r]);if(t){const n=t[o].find(t=>t[i]===ut[e][i]);n&&(u=n[s])}}else if(n&&n[o]){const t=n[o].find(t=>t[i]===ut[e][i]);t&&(u=t[s])}}return ut[e][a.name]||n(15,ut[e][a.name]=u||h,ut),void await Tt(e,a._formulaActor)}if(a.properties?.readonly&&!r.refInput){const o=ut[e][r.refClass];return Promise.resolve(getTaskFull(r.refClass,o,!0)).then(r=>{let o=a.refPos?r[a.refPos]||It(a.refPos,r):r[t];void 0!==a.factor&&(o*=a.factor),Array.isArray(o)&&(o=o.length?o[0][t]:""),n(15,ut[e][t]=o,ut),a._formulaActor&&Tt(e,a._formulaActor)})}const{refInput:m}=r;if(m&&ut[e]){const[t,n]=m.split(".");u=n?ut[e][n]:$[t]}if(l&&o!==i)c.map(t=>{n(15,ut[e][t]="",ut)});else{if(a.refItem2){const[r,o]=a.refItem2.split(".");$[r]&&getTaskFull(r,$[r]).then(r=>{r&&+r[o]&&n(15,ut[e][t]=r[o],ut)})}if(m&&!u||Dt(e,t)||i!==o){const o=w.find(t=>t.refClass===s),i=ut[e][o.name];if(r.selection){const o=getTaskSelection(r.selection+i.toString());if(o)return Promise.resolve(o).then(r=>n(15,ut[e][t]=r[t],ut))}const a="p$"+o.refClass+"$"+v;let c=await getList2(a);if(c){const r=c.find(({_id:t})=>t==i);if(r)return Promise.resolve(()=>{n(15,ut[e][t]=r[t],ut)})}return Promise.resolve(getTaskFull(o.refClass,i)).then(r=>n(15,ut[e][t]=r[t],ut))}}})):Promise.resolve(c.map(t=>{n(15,ut[e][t]="",ut)}))},Dt=(t,e)=>{let n=ut[t][e];return"number"===w.find(t=>t.name===e).type&&(n=Number(n||0)),!n},xt=t=>{if(!t)return;const{style:e,scrollHeight:n}=t;n&&(e.height=`${n}px`)};let Ot=!1;const Mt=t=>!(!C&&t>=ut.length-1),Pt=(t,e=!1)=>{const[n,r]=t.split(";");return _.name===r&&(!!Mt(e)&&((!1===e||e!=n)&&parseInt(n)))};w.filter(t=>t.properties?.value?.formula?.argument).forEach(t=>{t.properties.value.formula.argument.forEach(e=>{const n=w.find(t=>t.name===e.refItem)||w.find(t=>t.name===e.refItem);n&&(n._formulaActor=t.name)})});const Bt=(t,e=!1)=>{const r=`#accordion-content-${b}-${_.name}-${t} > div.form-field:not(.hidden)`,o=document.querySelectorAll(r);if(!o?.length)return;const i=o[o.length-1];tick().then(()=>{const e=`#accordion-content-${b}-${_.name}-${t} textarea`;Array.from(document.querySelectorAll(e)).forEach(xt)}).then(()=>{e&&i.scrollIntoView({behavior:"smooth",block:"end"})});for(const e of w){"number"==typeof e.properties?.value&&n(15,ut[t][e.name]=e.properties.value,ut);const r=_.preserve&&_.preserve.includes(e.preset);if(e.preset&&!r&&!ut[t][e.name]){const r=lt.get(e.preset);r&&n(15,ut[t][e.name]=r,ut)}!$._id&&e.refItem&&$[e.refItem]&&getTaskFull(e.refItem,$[e.refItem]).then(r=>n(15,ut[t][e.name]=r[e.name],ut))}if(!(t<1)&&ut?.length&&t===ut.length-1&&_.preserve&&!$._id)for(const e of _.preserve){if(!ut[t-1][e])continue;const r=$t(ut[t-1][e],!0);n(15,ut[t][e]=r,ut),lt.set(e,r)}},Ft=new Map,Lt=async()=>{if(!_.filter)return[];let t,e,n,{date:r,level:o,isDealer:i}=$;if(r)[t,e,n]=r.split(".");else{r=(new Date).toISOString();const o=r.split("T")[0];[n,e,t]=o.split("-")}const a=`${n}-${e}-${t}`,s=Ft.get("dv"),c=Ft.get("lv"),l=Ft.get("iv");if(s===a&&c===o&&l===!!i)return!1;let d;Ft.set("dv",a),Ft.set("lv",o),Ft.set("iv",!!i),d=i?{$ne:""}:{$eq:""};const u={dealer:d,"_task.status":"Ready",payable:{$lt:a},_total:{$gt:0}};o&&(u.levelReminder=o),o||(u.levelReminder={$in:[void 0,!1,""]});const h=[{$addFields:{_docId:{$toString:"$_id"}}},{$lookup:{from:"_task",localField:"_docId",foreignField:"docId",as:"_task"}},{$unwind:{path:"$_task",preserveNullAndEmptyArrays:!0}},{$match:u},{$sort:{payable:1,invoiceId:1}}];return await Request.getSectionView("invoice",h)},qt=async t=>{if(!_.filter){if(t[_.name]?.length)for(const e of w)if((e.properties?.prefetch||1e3)<t[_.name].length){const n="p$"+e.refClass+"$"+v;if(getList2(n))continue;setList(n,[]);const r=Vt(t[_.name],e.name);r?.length&&setList(n,Request.getSectionView(e.refClass,{_id:{$in:r}}))}n(20,j={record:t})}},Vt=(t,e)=>Array.from(new Set(t.map(t=>t[e]).filter(t=>!!t))),Ht=()=>{n(28,ot=!1),n(25,et=""),n(23,K=""),J=!0,n(24,tt=""),n(26,nt=""),n(22,X=!0)},Ut=async({detail:t})=>{const{refItem:e,refValue:r,refDescription:o,keyboard:i,input:a}=W;let s,c="reader_";for(;t.text.length>i.length;)t.text=t.text.slice(1);if(tt===t.text&&t.item){const e=c+t.item.name;return s=document.getElementById(e),s.value=+(st.get(t.item.name)||0)+1,st.set(t.item.name,s.value),s.focus(),J=!0,void n(23,K="")}if(n(28,ot=!1),n(25,et=""),n(24,tt=t.text||""),!tt)return;const l=w.find(t=>t.name===e)?.refClass;if(!l)return;let d=await Request.getSectionView(l,{[r]:tt});d?.length?(d=d[0],n(26,nt=d._id),n(25,et=o.map(t=>d[t]).join(", ")),n(28,ot=ut.find(t=>t[e]===nt)),setTimeout(()=>{w.filter(t=>t.properties?.reader).forEach(t=>{const e=document.getElementById("reader_"+t.name);e&&(e.value=st.get(t.name)||(ot?ot[t.name]:"")),st.set(t.name,e.value)});let e=1;if(a){const{refItem:t,refValue:n}=a;for(const r of n){const{value:n,factor:o}=r,i=d[t];n.includes(","+i.split("-")[0]+"-,")&&(e=o)}}if(t.item){const n=c+t.item.name;s=document.getElementById(n),s.value=+(st.get(t.item.name)||0)+e,st.set(t.item.name,s.value),s.focus()}else{const t=w.find(t=>t.properties?.reader).name,n=c+t;s=document.getElementById(n),s.value=+(st.get(t)||0)+e,st.set(t,s.value),s.focus()}J=!0,n(23,K="")},0)):setTimeout(()=>{J=!0,n(23,K=""),n(24,tt=""),st=new Map;const t=document.getElementById("reader_focusId");t&&t.focus()},0)},zt=()=>{n(25,et=""),n(26,nt=""),n(28,ot=!1),n(27,rt=!0),Wt(),st=new Map},Wt=()=>{if(!W.keyboard)return;const t=document.getElementById("reader_focusId");t&&t.focus()};onMount(async()=>{if(!_.filter&&(G||n(21,G=await Request.getEvent(v)),($._id||!G.input)&&!(ut.length>1)&&!I&&W?.autostart)){if("object"==typeof W.autostart){if(!W.autostart.user)return;{const t=i.user,[e,n]=W.autostart.user.split(":"),r=g.find(t=>t.name===e),o=r?.refClass;if(!o||!n)return;const a=await getTaskFull(o,$[e]);if(!a)return;if(a[n]!==t)return}}else if(!0!==W.autostart)return;it=!1,Ht()}});return t.$$set=t=>{"list"in t&&n(4,_=t.list),"mainSchema"in t&&n(79,g=t.mainSchema),"schema"in t&&n(80,w=t.schema),"record"in t&&n(0,$=t.record),"multiValues"in t&&n(5,y=t.multiValues),"classId"in t&&n(6,b=t.classId),"eventId"in t&&n(7,v=t.eventId),"disabled"in t&&n(1,I=t.disabled),"fixed"in t&&n(2,C=t.fixed),"template"in t&&n(81,E=t.template),"reqQuantity"in t&&n(3,A=t.reqQuantity),"open"in t&&n(12,S=t.open),"currency"in t&&n(8,k=t.currency),"notifyList"in t&&n(9,T=t.notifyList),"shortEdit"in t&&n(10,R=t.shortEdit),"dateInput"in t&&n(11,N=t.dateInput)},t.$$.update=()=>{if(528&t.$$.dirty[0]&&T&&!_.filter){const{itemName:t,value:e}=T;lt.set(t,e),t&&t===_.name&&n(0,$[t]=e,$)}1&t.$$.dirty[0]&&wt($),32768&t.$$.dirty[0]&&n(16,r=ut),122896&t.$$.dirty[0]&&r&&((()=>{if(F)n(17,L=ut?.reduce((t,e)=>t+(e._delete?0:+(e.quantity||0)),0)||0)})(),(()=>{if(V)n(14,H=ut?.reduce((t,e)=>t+(e._delete?0:+(e[q]||0)),0)||0)})(),(()=>{if(M)n(13,B=ut?.reduce((t,e)=>{if(e.amount){const n=e.amount??0;t+=e._delete?0:+n}else if(e.price){const n=(P?e.quantity??0:1)*(e.price??0);t+=e._delete?0:n}else if(e.value){const n=e.value??0;t+=e._delete?0:+n}return t},0)||0)})(),tick().then(()=>f("save",{listName:_.name,value:ut,amountValue:B,weeksValue:H}))),1048576&t.$$.dirty[2]&&(o=t=>z[t]?.split(" • ").filter(t=>!!t&&!/^[0-9a-f]{24}/.test(t)).slice(0,2).join(" · "))},[$,I,C,A,_,y,b,v,k,T,R,N,S,B,H,ut,r,L,U,W,j,G,X,K,tt,et,nt,rt,ot,ft,pt,_t,a,s,c,d,u,h,m,p,undefined,M,{name:"amountValue",properties:{decimals:2}},F,{name:"hoursValue",properties:{decimals:2}},V,{name:"weeksValue",properties:{decimals:1}},at,lt,dt,mt,async()=>{if(!I&&(G||n(21,G=await Request.getEvent(v)),($._id||!G.input)&&W&&!W.keyboard))try{const t=await getCameras$1();t?.length||n(19,W=!1)}catch{}},(t,e)=>{let n=t[e];return ct["pos"+e]&&(n=ct["pos"+e]),n&&w.filter(t=>!0!==t.properties?.hidden&&("dateRange"===t.type||void 0!==n[t.name])&&"textarea"!==t.properties?.format).map(t=>""===n[t.name]?"":"object"===t.type?o(n[t.name]):Array.isArray(n[t.name])?yt(n[t.name]):"boolean"===t.type?checkBoolean(n[t.name]):"number"===t.type?Rt(n[t.name],t.properties?.decimals||0):"dateRange"===t.type?checkDateRange(t.name,n):"date"===t.type?checkDate($t(n[t.name])):"datetime"===t.type?checkDateTime(n[t.name]):t.properties?.multi?"":n[t.name]).filter(t=>!!t).join(" • ")||"+"},t=>({detail:{row:e}})=>{if(f("task",{row:e}),!$._id&&e._id){for(let e=0;e<ut.length;e++)for(const n of t.item)Et(t,e,n,!U);n(18,U=!0)}},bt,({detail:t})=>{const{idx:e,value:n}=t;St(e,n)},async({detail:{className:t,itemName:e,value:n}})=>{if(Z.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===Y+"."+_.name)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&Z.set(t,o[0])},({detail:t})=>{const{idx:e,fieldId:n,value:r}=t;if(!r)return;const o=kt(r);let i=!1;ut.forEach((t,n)=>{if(e===n)return;const{start:r,end:a}=ut[n];r&&a&&o>kt(r)&&o<kt(a)&&(i=!0)});const a=document.getElementById(n);a?.classList?.toggle("invalid",i)},t=>({detail:e})=>{e.string?n(15,ut[t][e.itemName]=e.value,ut):n(15,ut[t][e.itemName]=Rt(e.value,e.decimals),ut)},(t,e,n)=>n=>{ut[e]._delete||(t(n),Bt(e,!0))},(t,e,r)=>o=>{if(n(15,ut[t]._delete=!ut[t]._delete,ut),ut[t]._delete){ct["pos"+t]={...ut[t]};for(const e of w)n(15,ut[t][e.name]="",ut);e&&r(o)}else{if(ct["pos"+t]){const e={};for(const n of w)e[n.name]=ct["pos"+t][n.name];n(15,ut[t]=e,ut)}ct["pos"+t]=void 0,e||r(o)}},t=>e=>{e.preventDefault(),n(30,pt=!1);const r=Pt(e.dataTransfer.getData(dragId),t);if(!1===r)return;e.dataTransfer.dropEffect="move";const o=[...ut].map((t,e)=>(t._index=e,t));r<t?(o.splice(t+1,0,o[r]),o.splice(r,1)):(o.splice(t,0,o[r]),o.splice(r+1,1)),o.map((t,e)=>setPraefix(t._index,e));let i=[];ft.map((t,e)=>{i[e]=ft[getPraefix(e)]}),n(29,ft=i),n(15,ut=o.map((t,e)=>(delete t._index,t))),Ot=!1},t=>e=>{if(!Mt(t))return!1;e.dataTransfer.effectAllowed="move",e.dataTransfer.dropEffect="move",e.dataTransfer.setData(dragId,t+";"+_.name),Ot=t},t=>e=>{const r=Pt(e.dataTransfer.getData(dragId),t)||Ot;return!1===r||r===t?n(30,pt=!1):void n(30,pt={top:r>t&&t,bottom:r<t&&t})},t=>t.preventDefault(),t=>t=>{n(30,pt=!1)},(t,e)=>r=>{setTimeout(()=>{Array.from(Z).forEach(([e,r])=>{ut[t][e]||n(15,ut[t][e]=r._id,ut)})},500);const o=new Set;for(const t of gt)o.add(t.refObj||Y);for(const e of Array.from(o))At(t,e);e(r),Bt(t)},t=>({detail:e})=>{Tt(t,e.item.name)},t=>async({detail:e})=>{const{itemName:r,itemType:o,source:i,target:a,sourceId:s,prop:c}=e;if(!s)return void n(15,ut[t][r]="",ut);let l=await getTaskFull(i,s);const d=l[c];l=await getTaskFull(_.name,$[_.name][t][_.name]);const u=l[a];let h="number"===o?0:"",m=0;u.forEach(t=>{const e=t[c];e.length<=m||e.every(t=>d.find(e=>e===t))&&(h=t[r],m=e.length)}),n(15,ut[t][r]=h,ut)},t=>t?.description||"Daten übernehmen",Ht,Ut,()=>{J=!0,n(23,K="")},(t,e=!1)=>e?(zt(),""):w.find(e=>e.name===t)?.designation||"",zt,()=>{const{refItem:t}=W,e={[t]:nt};let r;w.filter(t=>t.properties?.reader).forEach(t=>{const n=document.getElementById("reader_"+t.name);n&&(e[t.name]=n.value||("number"===t.type?0:""))});let o=ut;const i=o.findIndex(e=>e[t]===nt);i>=0?(r=o[i],o[i]={...r,...e}):o=o.slice(0,-1).concat(e),n(15,ut=o),w.filter(t=>t.properties?.reader).forEach(t=>{bt(t,i>=0?i:0)({detail:{oldValue:r?r[t.name]:"",value:e[t.name]}})}),it=!0,zt()},()=>{it&&(f("readerSave"),it=!1)},()=>{const t=new Map;dt.forEach(e=>{[].concat(e.properties.transfer.target).forEach(n=>{t.set(n,e.name)})});let e=0;for(const r of ut){for(const[o,i]of t)!r[o]&&r[i]&&n(15,ut[e][o]=r[i],ut);e++}n(16,r=ut)},(t,e)=>r=>{const{data:o}=r;"0123456789".includes(o)&&(J?(n(23,K=o.toString()),J=!1):(n(23,K+=o.toString()),"77"===K&&n(23,K="7"),K.length===t&&Ut({detail:{text:K,item:e}})))},g,w,E,z,function(t){H=t,n(14,H)},function(t){L=t,n(17,L)},function(t){B=t,n(13,B)},function(e){bubble(t,e)},function(t){rt=t,n(27,rt)},function(t){X=t,n(22,X)}]}class InputList extends SvelteComponent{constructor(t){super(),document_1$1.getElementById("svelte-9vv5ub-style")||add_css$1(),init(this,t,instance$2,create_fragment$2,safe_not_equal,{list:4,mainSchema:79,schema:80,record:0,multiValues:5,classId:6,eventId:7,disabled:1,fixed:2,template:81,reqQuantity:3,open:12,currency:8,notifyList:9,shortEdit:10,dateInput:11},[-1,-1,-1,-1,-1,-1])}}const{Boolean:Boolean_1,document:document_1}=globals;function add_css(){var t=element("style");t.id="svelte-lfqa43-style",t.textContent="form.disabled.svelte-lfqa43 input.svelte-lfqa43{background-color:red !important}input:placeholder-shown{font-style:italic}form.svelte-lfqa43.svelte-lfqa43{min-width:25em}hr[data-text]{margin-bottom:1em !important}@media only screen and (min-width: 600px){form.svelte-lfqa43.svelte-lfqa43{min-width:30em}}.fEmbedded.svelte-lfqa43.svelte-lfqa43,.fTask.svelte-lfqa43.svelte-lfqa43{overflow-y:auto;padding-right:1em;overflow-x:hidden}.fEmbedded.svelte-lfqa43.svelte-lfqa43{height:fit-content;min-height:30vh;max-height:60vh}.fTask.svelte-lfqa43.svelte-lfqa43{height:fit-content;max-height:70vh}.sTask.svelte-lfqa43.svelte-lfqa43{height:95%;display:inline-grid}.sTask.svelte-lfqa43 .btn.svelte-lfqa43{display:initial !important}.form--buttons.svelte-lfqa43.svelte-lfqa43{display:flex;gap:1em;padding-top:0.75em}.flex_div.svelte-lfqa43.svelte-lfqa43{display:flex;margin-top:1em;gap:0.5em;justify-content:space-between}section.sTask div.date-picker div.dropdown-shell div.dropdown.calendar{position:fixed !important;left:auto !important}form.fTask div.form-field{min-width:49vw}section.data + .modal-overlay > .dialog{margin-top:-5em}",append(document_1.head,t)}function get_each_context(t,e,n){const r=t.slice();return r[203]=e[n],r[205]=n,r}function get_each_context_1(t,e,n){const r=t.slice();return r[207]=e[n],r}function get_each_context_2(t,e,n){const r=t.slice();return r[210]=e[n],r}function create_catch_block(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_then_block(t){let e,n,r=t[206]&&create_if_block_5(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,e){t[206]&&r.p(t,e)},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_5(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$=t[23]&&create_if_block_23(t),y=t[40]&&create_if_block_22(t),b=t[0].items,v=[];for(let e=0;e<b.length;e+=1)v[e]=create_each_block_2(get_each_context_2(t,b,e));const I=t=>transition_out(v[t],1,1,()=>{v[t]=null});let C=t[0].list&&create_if_block_16(t),E=!t[4]&&!t[2]&&t[38]&&t[5]&&!t[43]&&create_if_block_15(t);h=new t[48]({props:{outline:!0,$$slots:{default:[create_default_slot_24]},$$scope:{ctx:t}}}),h.$on("click",t[68]);const A=[create_if_block_6,create_if_block_8],S=[];function k(t,e){return t[11]?0:t[38]?1:-1}return~(f=k(t))&&(p=S[f]=A[f](t)),{c(){e=element("section"),$&&$.c(),n=space(),y&&y.c(),r=space(),o=element("form"),i=element("input"),s=space();for(let t=0;t<v.length;t+=1)v[t].c();c=space(),C&&C.c(),l=space(),E&&E.c(),d=space(),u=element("div"),create_component(h.$$.fragment),m=space(),p&&p.c(),attr(i,"class",null_to_empty(t[55])+" svelte-lfqa43"),attr(i,"name","_id"),attr(i,"type","hidden"),i.value=a=t[10]._id||"",attr(o,"class",null_to_empty(t[56])+" svelte-lfqa43"),attr(o,"id",t[55]),attr(u,"class","form--buttons svelte-lfqa43"),attr(e,"class",null_to_empty(t[57])+" svelte-lfqa43")},m(a,p){insert(a,e,p),$&&$.m(e,null),append(e,n),y&&y.m(e,null),append(e,r),append(e,o),append(o,i),append(o,s);for(let t=0;t<v.length;t+=1)v[t].m(o,null);append(o,c),C&&C.m(o,null),append(e,l),E&&E.m(e,null),append(e,d),append(e,u),mount_component(h,u,null),append(u,m),~f&&S[f].m(u,null),_=!0,g||(w=[listen(o,"keydown",t[73]),listen(o,"submit",prevent_default(t[67]))],g=!0)},p(t,s){if(t[23]?$?($.p(t,s),8388608&s[0]&&transition_in($,1)):($=create_if_block_23(t),$.c(),transition_in($,1),$.m(e,n)):$&&(group_outros(),transition_out($,1,1,()=>{$=null}),check_outros()),t[40]?y?(y.p(t,s),512&s[1]&&transition_in(y,1)):(y=create_if_block_22(t),y.c(),transition_in(y,1),y.m(e,r)):y&&(group_outros(),transition_out(y,1,1,()=>{y=null}),check_outros()),(!_||1024&s[0]&&a!==(a=t[10]._id||""))&&(i.value=a),1074861057&s[0]|553652226&s[1]|2033544&s[2]){let e;for(b=t[0].items,e=0;e<b.length;e+=1){const n=get_each_context_2(t,b,e);v[e]?(v[e].p(n,s),transition_in(v[e],1)):(v[e]=create_each_block_2(n),v[e].c(),transition_in(v[e],1),v[e].m(o,c))}for(group_outros(),e=b.length;e<v.length;e+=1)I(e);check_outros()}t[0].list?C?(C.p(t,s),1&s[0]&&transition_in(C,1)):(C=create_if_block_16(t),C.c(),transition_in(C,1),C.m(o,null)):C&&(group_outros(),transition_out(C,1,1,()=>{C=null}),check_outros()),t[4]||t[2]||!t[38]||!t[5]||t[43]?E&&(group_outros(),transition_out(E,1,1,()=>{E=null}),check_outros()):E?(E.p(t,s),52&s[0]|4224&s[1]&&transition_in(E,1)):(E=create_if_block_15(t),E.c(),transition_in(E,1),E.m(e,d));const l={};134217728&s[6]&&(l.$$scope={dirty:s,ctx:t}),h.$set(l);let m=f;f=k(t),f===m?~f&&S[f].p(t,s):(p&&(group_outros(),transition_out(S[m],1,1,()=>{S[m]=null}),check_outros()),~f?(p=S[f],p?p.p(t,s):(p=S[f]=A[f](t),p.c()),transition_in(p,1),p.m(u,null)):p=null)},i(t){if(!_){transition_in($),transition_in(y);for(let t=0;t<b.length;t+=1)transition_in(v[t]);transition_in(C),transition_in(E),transition_in(h.$$.fragment,t),transition_in(p),_=!0}},o(t){transition_out($),transition_out(y),v=v.filter(Boolean_1);for(let t=0;t<v.length;t+=1)transition_out(v[t]);transition_out(C),transition_out(E),transition_out(h.$$.fragment,t),transition_out(p),_=!1},d(t){t&&detach(e),$&&$.d(),y&&y.d(),destroy_each(v,t),C&&C.d(),E&&E.d(),destroy_component(h),~f&&S[f].d(),g=!1,run_all(w)}}}function create_if_block_23(t){let e,n;return e=new t[48]({props:{disabled:t[43]||t[10]._id,filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_30]},$$scope:{ctx:t}}}),e.$on("click",t[90]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1024&n[0]|4096&n[1]&&(r.disabled=t[43]||t[10]._id),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_30(t){let e,n,r;return n=new CameraIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="QR Code scannen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_22(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.75; margin-bottom: .5em;",$$slots:{default:[create_default_slot_29]},$$scope:{ctx:t}}}),e.$on("click",t[88]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_29(t){let e,n,r;return n=new FilePlusIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Dokument ergänzen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_21(t){let e,n;return e=new InputFormField({props:{classId:t[55],item:t[210],selection:t[210].selection,record:t[10],disabled:t[43],eventId:t[65],multiValues:t[60],notifyList:t[12],toDelete:t[20],currency:t[16],changeValue:t[32],initFinished:t[30]}}),e.$on("save",t[72]),e.$on("task",t[69]),e.$on("notify",t[70]),e.$on("safeReference",t[79]),e.$on("multi",t[71]),e.$on("defPrep",t[78]),e.$on("record",t[80]),e.$on("objRecord",t[81]),e.$on("formula",t[82]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[0]&&(r.item=t[210]),1&n[0]&&(r.selection=t[210].selection),1024&n[0]&&(r.record=t[10]),4096&n[1]&&(r.disabled=t[43]),4096&n[0]&&(r.notifyList=t[12]),1048576&n[0]&&(r.toDelete=t[20]),65536&n[0]&&(r.currency=t[16]),2&n[1]&&(r.changeValue=t[32]),1073741824&n[0]&&(r.initFinished=t[30]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_2(t){let e,n,r="list"!==t[210].type&&create_if_block_21(t);return{c(){r&&r.c(),e=empty()},m(t,o){r&&r.m(t,o),insert(t,e,o),n=!0},p(t,n){"list"!==t[210].type?r?(r.p(t,n),1&n[0]&&transition_in(r,1)):(r=create_if_block_21(t),r.c(),transition_in(r,1),r.m(e.parentNode,e)):r&&(group_outros(),transition_out(r,1,1,()=>{r=null}),check_outros())},i(t){n||(transition_in(r),n=!0)},o(t){transition_out(r),n=!1},d(t){r&&r.d(t),t&&detach(e)}}}function create_if_block_16(t){let e,n,r,o,i,a=t[7]&&t[61]&&t[17]&&0!=t[17]&&create_if_block_20(t),s=t[18]&&create_if_block_19(t),c=t[62]&&t[31]&&0!=t[31]&&create_if_block_18(t),l=t[0].list,d=[];for(let e=0;e<l.length;e+=1)d[e]=create_each_block_1(get_each_context_1(t,l,e));const u=t=>transition_out(d[t],1,1,()=>{d[t]=null});return{c(){a&&a.c(),e=space(),s&&s.c(),n=space(),c&&c.c(),r=space();for(let t=0;t<d.length;t+=1)d[t].c();o=empty()},m(t,l){a&&a.m(t,l),insert(t,e,l),s&&s.m(t,l),insert(t,n,l),c&&c.m(t,l),insert(t,r,l);for(let e=0;e<d.length;e+=1)d[e].m(t,l);insert(t,o,l),i=!0},p(t,i){if(t[7]&&t[61]&&t[17]&&0!=t[17]?a?(a.p(t,i),131200&i[0]&&transition_in(a,1)):(a=create_if_block_20(t),a.c(),transition_in(a,1),a.m(e.parentNode,e)):a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()),t[18]?s?(s.p(t,i),262144&i[0]&&transition_in(s,1)):(s=create_if_block_19(t),s.c(),transition_in(s,1),s.m(n.parentNode,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),t[62]&&t[31]&&0!=t[31]?c?(c.p(t,i),1&i[1]&&transition_in(c,1)):(c=create_if_block_18(t),c.c(),transition_in(c,1),c.m(r.parentNode,r)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros()),6411333&i[0]|553652236&i[1]|134480904&i[2]){let e;for(l=t[0].list,e=0;e<l.length;e+=1){const n=get_each_context_1(t,l,e);d[e]?(d[e].p(n,i),transition_in(d[e],1)):(d[e]=create_each_block_1(n),d[e].c(),transition_in(d[e],1),d[e].m(o.parentNode,o))}for(group_outros(),e=l.length;e<d.length;e+=1)u(e);check_outros()}},i(t){if(!i){transition_in(a),transition_in(s),transition_in(c);for(let t=0;t<l.length;t+=1)transition_in(d[t]);i=!0}},o(t){transition_out(a),transition_out(s),transition_out(c),d=d.filter(Boolean_1);for(let t=0;t<d.length;t+=1)transition_out(d[t]);i=!1},d(t){a&&a.d(t),t&&detach(e),s&&s.d(t),t&&detach(n),c&&c.d(t),t&&detach(r),destroy_each(d,t),t&&detach(o)}}}function create_if_block_20(t){let e,n;return e=new t[49]({props:{name:"Total Dokument",nameClass:"formField_italic",$$slots:{default:[create_default_slot_28]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};196608&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_28(t){let e,n,r;function o(e){t[105](e)}let i={item:t[58],disabled:!0,currency:t[16]};return void 0!==t[17]&&(i.value=t[17]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};65536&r[0]&&(o.currency=t[16]),!n&&131072&r[0]&&(n=!0,o.value=t[17],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_19(t){let e,n;return e=new t[49]({props:{name:"Total MWSt "+(t[19]?"("+t[19]+"%)":""),nameClass:"formField_italic",$$slots:{default:[create_default_slot_27]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};524288&n[0]&&(r.name="Total MWSt "+(t[19]?"("+t[19]+"%)":"")),327680&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_27(t){let e,n,r;function o(e){t[106](e)}let i={item:t[59],disabled:!0,currency:t[16]};return void 0!==t[18]&&(i.value=t[18]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};65536&r[0]&&(o.currency=t[16]),!n&&262144&r[0]&&(n=!0,o.value=t[18],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_18(t){let e,n;return e=new t[49]({props:{name:"Gesamtzeit in Wochen",nameClass:"formField_italic",$$slots:{default:[create_default_slot_26]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};1&n[1]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_26(t){let e,n,r;function o(e){t[107](e)}let i={item:t[63],disabled:!0};return void 0!==t[31]&&(i.value=t[31]),e=new InputNumber({props:i}),binding_callbacks.push(()=>bind(e,"value",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};!n&&1&r[1]&&(n=!0,o.value=t[31],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_else_block_2(t){let e,n,r,o;return e=new t[47]({props:{text:t[207].designation}}),r=new InputObject({props:{classId:t[55],open:!t[2]&&1===t[0].list.length,list:t[207],template:t[33],eventId:t[65],schema:t[207].item,record:t[10],disabled:t[43],currency:t[16],update:t[14]}}),{c(){create_component(e.$$.fragment),n=space(),create_component(r.$$.fragment)},m(t,i){mount_component(e,t,i),insert(t,n,i),mount_component(r,t,i),o=!0},p(t,n){const o={};1&n[0]&&(o.text=t[207].designation),e.$set(o);const i={};5&n[0]&&(i.open=!t[2]&&1===t[0].list.length),1&n[0]&&(i.list=t[207]),4&n[1]&&(i.template=t[33]),1&n[0]&&(i.schema=t[207].item),1024&n[0]&&(i.record=t[10]),4096&n[1]&&(i.disabled=t[43]),65536&n[0]&&(i.currency=t[16]),16384&n[0]&&(i.update=t[14]),r.$set(i)},i(t){o||(transition_in(e.$$.fragment,t),transition_in(r.$$.fragment,t),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(r.$$.fragment,t),o=!1},d(t){destroy_component(e,t),t&&detach(n),destroy_component(r,t)}}}function create_if_block_17(t){let e,n;return e=new InputList({props:{classId:t[55],open:t[22],list:t[207],template:t[34],eventId:t[65],schema:t[207].item,mainSchema:t[0].items,record:t[10],disabled:t[43],fixed:t[207].fixed,reqQuantity:t[21],currency:t[16],notifyList:t[12],multiValues:t[60],shortEdit:t[6],dateInput:t[15]}}),e.$on("save",t[72]),e.$on("record",t[80]),e.$on("readerSave",t[89]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4194304&n[0]&&(r.open=t[22]),1&n[0]&&(r.list=t[207]),8&n[1]&&(r.template=t[34]),1&n[0]&&(r.schema=t[207].item),1&n[0]&&(r.mainSchema=t[0].items),1024&n[0]&&(r.record=t[10]),4096&n[1]&&(r.disabled=t[43]),1&n[0]&&(r.fixed=t[207].fixed),2097152&n[0]&&(r.reqQuantity=t[21]),65536&n[0]&&(r.currency=t[16]),4096&n[0]&&(r.notifyList=t[12]),64&n[0]&&(r.shortEdit=t[6]),32768&n[0]&&(r.dateInput=t[15]),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_each_block_1(t){let e,n,r,o;const i=[create_if_block_17,create_else_block_2],a=[];function s(t,e){return"array"===t[207].type?0:1}return e=s(t),n=a[e]=i[e](t),{c(){n.c(),r=empty()},m(t,n){a[e].m(t,n),insert(t,r,n),o=!0},p(t,o){let c=e;e=s(t),e===c?a[e].p(t,o):(group_outros(),transition_out(a[c],1,1,()=>{a[c]=null}),check_outros(),n=a[e],n?n.p(t,o):(n=a[e]=i[e](t),n.c()),transition_in(n,1),n.m(r.parentNode,r))},i(t){o||(transition_in(n),o=!0)},o(t){transition_out(n),o=!1},d(t){a[e].d(t),t&&detach(r)}}}function create_if_block_15(t){let e,n,r,o;function i(e){t[108](e)}let a={title:"",$$slots:{default:[create_default_slot_25]},$$scope:{ctx:t}};return void 0!==t[37]&&(a.checked=t[37]),n=new t[50]({props:a}),binding_callbacks.push(()=>bind(n,"checked",i)),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"class","askNext"),set_style(e,"margin-top","1em"),set_style(e,"margin-left","23em")},m(t,r){insert(t,e,r),mount_component(n,e,null),o=!0},p(t,e){const o={};134217728&e[6]&&(o.$$scope={dirty:e,ctx:t}),!r&&64&e[1]&&(r=!0,o.checked=t[37],add_flush_callback(()=>r=!1)),n.$set(o)},i(t){o||(transition_in(n.$$.fragment,t),o=!0)},o(t){transition_out(n.$$.fragment,t),o=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot_25(t){let e;return{c(){e=element("span"),e.textContent="Weiter erfassen",set_style(e,"margin-left",".75em")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_24(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_8(t){let e,n,r,o,i,a=!(t[39]||t[37])&&create_if_block_14(t),s=t[5]&&!t[43]&&create_if_block_13(t),c=t[2]&&t[3]&&create_if_block_12(t),l=t[35]&&create_if_block_9(t);return{c(){a&&a.c(),e=space(),s&&s.c(),n=space(),c&&c.c(),r=space(),l&&l.c(),o=empty()},m(t,d){a&&a.m(t,d),insert(t,e,d),s&&s.m(t,d),insert(t,n,d),c&&c.m(t,d),insert(t,r,d),l&&l.m(t,d),insert(t,o,d),i=!0},p(t,i){t[39]||t[37]?a&&(group_outros(),transition_out(a,1,1,()=>{a=null}),check_outros()):a?(a.p(t,i),320&i[1]&&transition_in(a,1)):(a=create_if_block_14(t),a.c(),transition_in(a,1),a.m(e.parentNode,e)),t[5]&&!t[43]?s?(s.p(t,i),32&i[0]|4096&i[1]&&transition_in(s,1)):(s=create_if_block_13(t),s.c(),transition_in(s,1),s.m(n.parentNode,n)):s&&(group_outros(),transition_out(s,1,1,()=>{s=null}),check_outros()),t[2]&&t[3]?c?(c.p(t,i),12&i[0]&&transition_in(c,1)):(c=create_if_block_12(t),c.c(),transition_in(c,1),c.m(r.parentNode,r)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros()),t[35]?l?(l.p(t,i),16&i[1]&&transition_in(l,1)):(l=create_if_block_9(t),l.c(),transition_in(l,1),l.m(o.parentNode,o)):l&&(group_outros(),transition_out(l,1,1,()=>{l=null}),check_outros())},i(t){i||(transition_in(a),transition_in(s),transition_in(c),transition_in(l),i=!0)},o(t){transition_out(a),transition_out(s),transition_out(c),transition_out(l),i=!1},d(t){a&&a.d(t),t&&detach(e),s&&s.d(t),t&&detach(n),c&&c.d(t),t&&detach(r),l&&l.d(t),t&&detach(o)}}}function create_if_block_6(t){let e,n,r,o;e=new t[48]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[create_default_slot_16]},$$scope:{ctx:t}}}),e.$on("click",t[76]);let i=t[36]&&create_if_block_7(t);return{c(){create_component(e.$$.fragment),n=space(),i&&i.c(),r=empty()},m(t,a){mount_component(e,t,a),insert(t,n,a),i&&i.m(t,a),insert(t,r,a),o=!0},p(t,n){const o={};134217728&n[6]&&(o.$$scope={dirty:n,ctx:t}),e.$set(o),t[36]?i?(i.p(t,n),32&n[1]&&transition_in(i,1)):(i=create_if_block_7(t),i.c(),transition_in(i,1),i.m(r.parentNode,r)):i&&(group_outros(),transition_out(i,1,1,()=>{i=null}),check_outros())},i(t){o||(transition_in(e.$$.fragment,t),transition_in(i),o=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(i),o=!1},d(t){destroy_component(e,t),t&&detach(n),i&&i.d(t),t&&detach(r)}}}function create_if_block_14(t){let e,n;return e=new t[48]({props:{class:"close",disabled:t[43],form:t[55],filled:!0,type:"submit",$$slots:{default:[create_default_slot_23]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n[1]&&(r.disabled=t[43]),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_23(t){let e;return{c(){e=text("Speichern und schliessen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_13(t){let e,n;return e=new t[48]({props:{form:t[55],filled:!0,type:"submit",style:"opacity: 0.75;",$$slots:{default:[create_default_slot_22]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};256&n[1]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_22(t){let e,n=(t[39]||"Speichern")+"";return{c(){e=text(n)},m(t,n){insert(t,e,n)},p(t,r){256&r[1]&&n!==(n=(t[39]||"Speichern")+"")&&set_data(e,n)},d(t){t&&detach(e)}}}function create_if_block_12(t){let e,n;return e=new t[48]({props:{disabled:t[43],danger:!0,outline:!0,$$slots:{default:[create_default_slot_21]},$$scope:{ctx:t}}}),e.$on("click",t[84]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};4096&n[1]&&(r.disabled=t[43]),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_21(t){let e;return{c(){e=text("Löschen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_if_block_9(t){let e,n,r,o,i;const a=[create_if_block_11,create_else_block_1],s=[];e=function(t){return t[64]?0:1}(t),n=s[e]=a[e](t);let c=t[36]&&create_if_block_10(t);return{c(){n.c(),r=space(),c&&c.c(),o=empty()},m(t,n){s[e].m(t,n),insert(t,r,n),c&&c.m(t,n),insert(t,o,n),i=!0},p(t,e){n.p(t,e),t[36]?c?(c.p(t,e),32&e[1]&&transition_in(c,1)):(c=create_if_block_10(t),c.c(),transition_in(c,1),c.m(o.parentNode,o)):c&&(group_outros(),transition_out(c,1,1,()=>{c=null}),check_outros())},i(t){i||(transition_in(n),transition_in(c),i=!0)},o(t){transition_out(n),transition_out(c),i=!1},d(t){s[e].d(t),t&&detach(r),c&&c.d(t),t&&detach(o)}}}function create_else_block_1(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[create_default_slot_20]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[74](t[1]))&&t[74](t[1]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};134217728&r[6]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_11(t){let e,n;return e=new PopOver({props:{text:t[64],extended:!0,$$slots:{default:[create_default_slot_18]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};2&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_20(t){let e,n,r;return n=new PrinterIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent=`${t[83]()}`,create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_default_slot_19(t){let e,n,r;return n=new PrinterIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent=`${t[83]()}`,create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_default_slot_18(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.6;",$$slots:{default:[create_default_slot_19]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[74](t[1]))&&t[74](t[1]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};134217728&r[6]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block_10(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[create_default_slot_17]},$$scope:{ctx:t}}}),e.$on("click",function(){is_function(t[75](t[1]))&&t[75](t[1]).apply(this,arguments)}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(n,r){t=n;const o={};134217728&r[6]&&(o.$$scope={dirty:r,ctx:t}),e.$set(o)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_17(t){let e,n,r;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Daten",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_default_slot_16(t){let e,n,r;return n=new PrinterIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Erstellen",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_if_block_7(t){let e,n;return e=new t[48]({props:{filled:!0,style:"opacity: 0.75;",$$slots:{default:[create_default_slot_15]},$$scope:{ctx:t}}}),e.$on("click",t[77]),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_15(t){let e,n,r;return n=new SearchIcon({props:{size:"18"}}),{c(){e=element("span"),e.textContent="Daten",create_component(n.$$.fragment),set_style(e,"margin-right",".75em")},m(t,o){insert(t,e,o),mount_component(n,t,o),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n,t)}}}function create_pending_block(t){return{c:noop,m:noop,p:noop,i:noop,o:noop,d:noop}}function create_default_slot_14(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_13(t){let e;return{c(){e=text("Ja, bitte löschen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_12(t){let e,n,r,o,i,a,s,c,l;return a=new t[48]({props:{filled:!0,$$slots:{default:[create_default_slot_14]},$$scope:{ctx:t}}}),a.$on("click",t[109]),c=new t[48]({props:{danger:!0,outline:!0,$$slots:{default:[create_default_slot_13]},$$scope:{ctx:t}}}),c.$on("click",t[87]),{c(){e=element("p"),e.textContent="Willst du diese Daten löschen?",n=space(),r=element("p"),r.textContent="Das kann nicht rückgängig gemacht werden.",o=space(),i=element("div"),create_component(a.$$.fragment),s=space(),create_component(c.$$.fragment),attr(i,"class","flex_div svelte-lfqa43")},m(t,d){insert(t,e,d),insert(t,n,d),insert(t,r,d),insert(t,o,d),insert(t,i,d),mount_component(a,i,null),append(i,s),mount_component(c,i,null),l=!0},p(t,e){const n={};134217728&e[6]&&(n.$$scope={dirty:e,ctx:t}),a.$set(n);const r={};134217728&e[6]&&(r.$$scope={dirty:e,ctx:t}),c.$set(r)},i(t){l||(transition_in(a.$$.fragment,t),transition_in(c.$$.fragment,t),l=!0)},o(t){transition_out(a.$$.fragment,t),transition_out(c.$$.fragment,t),l=!1},d(t){t&&detach(e),t&&detach(n),t&&detach(r),t&&detach(o),t&&detach(i),destroy_component(a),destroy_component(c)}}}function create_title_icon_slot_2(t){let e,n,r;return n=new AlertTriangleIcon({props:{size:"25"}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"slot","title-icon")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot_11(t){let e,n;return e=new t[46]({props:{title:"Bestätigung",closeCallback:t[202],danger:!0,$$slots:{"title-icon":[create_title_icon_slot_2],default:[create_default_slot_12]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};65536&n[6]&&(r.closeCallback=t[202]),134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_if_block(t){let e,n,r;function o(e){t[112](e)}let i={$$slots:{default:[create_default_slot_7,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};return void 0!==t[24]&&(i.open=t[24]),e=new t[45]({props:i}),binding_callbacks.push(()=>bind(e,"open",o)),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};1048576e3&r[0]|134283264&r[6]&&(o.$$scope={dirty:r,ctx:t}),!n&&16777216&r[0]&&(n=!0,o.open=t[24],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_if_block_4(t){let e,n,r,o,i,a=t[93](t[23].refItem,!0)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" nicht gefunden!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){8388608&e[0]&&a!==(a=t[93](t[23].refItem,!0)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_3(t){let e,n,r,o,i,a=t[93](t[23].refItem)+"";return{c(){e=element("tr"),n=element("th"),r=element("div"),o=text(a),i=text(" bereits eingefügt!"),set_style(r,"color","red"),attr(n,"colspan","2")},m(t,a){insert(t,e,a),append(e,n),append(n,r),append(r,o),append(r,i)},p(t,e){8388608&e[0]&&a!==(a=t[93](t[23].refItem)+"")&&set_data(o,a)},d(t){t&&detach(e)}}}function create_if_block_1(t){let e;let n=function(t){return"number"===t[203].type?create_if_block_2:create_else_block}(t),r=n(t);return{c(){r.c(),e=empty()},m(t,n){r.m(t,n),insert(t,e,n)},p(t,e){r.p(t,e)},d(t){r.d(t),t&&detach(e)}}}function create_else_block(t){let e;return{c(){e=element("input"),attr(e,"id","reader_"+t[203].name),attr(e,"type","text")},m(t,n){insert(t,e,n)},p:noop,d(t){t&&detach(e)}}}function create_if_block_2(t){let e;return{c(){e=element("input"),set_style(e,"width","4em"),attr(e,"id","reader_"+t[203].name),attr(e,"type","number"),attr(e,"min","0")},m(t,n){insert(t,e,n)},p:noop,d(t){t&&detach(e)}}}function create_each_block(t){let e,n,r,o,i,a,s=t[93](t[203].name)+"",c=t[25]&&t[26]&&create_if_block_1(t);return{c(){e=element("tr"),n=element("th"),r=text(s),o=space(),i=element("td"),c&&c.c(),a=space()},m(t,s){insert(t,e,s),append(e,n),append(n,r),append(e,o),append(e,i),c&&c.m(i,null),append(e,a)},p(t,e){t[25]&&t[26]?c?c.p(t,e):(c=create_if_block_1(t),c.c(),c.m(i,null)):c&&(c.d(1),c=null)},d(t){t&&detach(e),c&&c.d()}}}function create_default_slot_10(t){let e;return{c(){e=text("Verwerfen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_9(t){let e;return{c(){e=text("Speichern")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_8(t){let e,n,r,o,i,a,s,c,l,d,u,h,m,f,p,_,g,w,$,y,b,v,I,C,E,A=t[93](t[23].refItem)+"";function S(e){t[111](e)}let k={keyboard:t[23].keyboard,codeTypes:t[23].codeTypes};function T(t,e){return t[29]?create_if_block_3:t[25]&&!t[27]?create_if_block_4:void 0}void 0!==t[28]&&(k.readerInit=t[28]),e=new InputReader({props:k}),binding_callbacks.push(()=>bind(e,"readerInit",S)),e.$on("scan",t[91]),e.$on("exit",t[96]);let R=T(t),N=R&&R(t),D=t[92](),x=[];for(let e=0;e<D.length;e+=1)x[e]=create_each_block(get_each_context(t,D,e));return v=new t[48]({props:{disabled:!t[25],outline:!0,style:"float: left;",$$slots:{default:[create_default_slot_10]},$$scope:{ctx:t}}}),v.$on("click",t[94]),C=new t[48]({props:{disabled:!t[27],filled:!0,style:"float: right;",$$slots:{default:[create_default_slot_9]},$$scope:{ctx:t}}}),C.$on("click",t[95]),{c(){create_component(e.$$.fragment),r=space(),o=element("div"),i=element("table"),a=element("tr"),s=element("th"),s.textContent="Code",c=space(),l=element("td"),d=text(t[25]),u=space(),h=element("tr"),m=element("th"),f=text(A),p=space(),_=element("td"),g=element("div"),w=text(t[26]),$=space(),N&&N.c(),y=space();for(let t=0;t<x.length;t+=1)x[t].c();b=space(),create_component(v.$$.fragment),I=space(),create_component(C.$$.fragment),set_style(g,"max-width","14em"),set_style(i,"margin-top","1em"),set_style(i,"margin-bottom","1em"),set_style(i,"text-align","left"),set_style(o,"position","relative"),set_style(o,"z-index","1000"),set_style(o,"background-color","white"),set_style(o,"height","225px")},m(t,n){mount_component(e,t,n),insert(t,r,n),insert(t,o,n),append(o,i),append(i,a),append(a,s),append(a,c),append(a,l),append(l,d),append(i,u),append(i,h),append(h,m),append(m,f),append(h,p),append(h,_),append(_,g),append(g,w),append(i,$),N&&N.m(i,null),append(i,y);for(let t=0;t<x.length;t+=1)x[t].m(i,null);append(o,b),mount_component(v,o,null),append(o,I),mount_component(C,o,null),E=!0},p(t,r){const o={};if(8388608&r[0]&&(o.keyboard=t[23].keyboard),8388608&r[0]&&(o.codeTypes=t[23].codeTypes),!n&&268435456&r[0]&&(n=!0,o.readerInit=t[28],add_flush_callback(()=>n=!1)),e.$set(o),(!E||33554432&r[0])&&set_data(d,t[25]),(!E||8388608&r[0])&&A!==(A=t[93](t[23].refItem)+"")&&set_data(f,A),(!E||67108864&r[0])&&set_data(w,t[26]),R===(R=T(t))&&N?N.p(t,r):(N&&N.d(1),N=R&&R(t),N&&(N.c(),N.m(i,y))),100663296&r[0]|1073741824&r[2]|1&r[3]){let e;for(D=t[92](),e=0;e<D.length;e+=1){const n=get_each_context(t,D,e);x[e]?x[e].p(n,r):(x[e]=create_each_block(n),x[e].c(),x[e].m(i,null))}for(;e<x.length;e+=1)x[e].d(1);x.length=D.length}const a={};33554432&r[0]&&(a.disabled=!t[25]),134217728&r[6]&&(a.$$scope={dirty:r,ctx:t}),v.$set(a);const s={};134217728&r[0]&&(s.disabled=!t[27]),134217728&r[6]&&(s.$$scope={dirty:r,ctx:t}),C.$set(s)},i(t){E||(transition_in(e.$$.fragment,t),transition_in(v.$$.fragment,t),transition_in(C.$$.fragment,t),E=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(v.$$.fragment,t),transition_out(C.$$.fragment,t),E=!1},d(t){destroy_component(e,t),t&&detach(r),t&&detach(o),N&&N.d(),destroy_each(x,t),destroy_component(v),destroy_component(C)}}}function create_default_slot_7(t){let e,n;return e=new t[46]({props:{title:"Scannen",class:"reader",closeCallback:t[202],$$slots:{default:[create_default_slot_8]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};65536&n[6]&&(r.closeCallback=t[202]),1048576e3&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_6(t){let e;return{c(){e=text("Abbrechen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_5(t){let e,n,r,o,i;return o=new t[48]({props:{filled:!0,$$slots:{default:[create_default_slot_6]},$$scope:{ctx:t}}}),o.$on("click",t[113]),{c(){e=element("progress"),n=space(),r=element("div"),create_component(o.$$.fragment),set_style(e,"width","100%"),attr(e,"id","file"),attr(e,"max","100"),e.value=t[42],attr(r,"class","flex_div svelte-lfqa43")},m(t,a){insert(t,e,a),insert(t,n,a),insert(t,r,a),mount_component(o,r,null),i=!0},p(t,n){(!i||2048&n[1])&&(e.value=t[42]);const r={};134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),o.$set(r)},i(t){i||(transition_in(o.$$.fragment,t),i=!0)},o(t){transition_out(o.$$.fragment,t),i=!1},d(t){t&&detach(e),t&&detach(n),t&&detach(r),destroy_component(o)}}}function create_title_icon_slot_1(t){let e,n,r;return n=new AlertTriangleIcon({props:{size:"25"}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"slot","title-icon")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot_4(t){let e,n;return e=new t[46]({props:{title:"Auswertung wird erstellt",closeCallback:t[202],$$slots:{"title-icon":[create_title_icon_slot_1],default:[create_default_slot_5]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};65536&n[6]&&(r.closeCallback=t[202]),2048&n[1]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_default_slot_3(t){let e,n;return{c(){e=element("p"),n=text(t[9])},m(t,r){insert(t,e,r),append(e,n)},p(t,e){512&e[0]&&set_data(n,t[9])},d(t){t&&detach(e)}}}function create_default_slot_2(t){let e;return{c(){e=text("Schliessen")},m(t,n){insert(t,e,n)},d(t){t&&detach(e)}}}function create_default_slot_1(t){let e,n,r,o,i;return e=new t[51]({props:{outline:!0,$$slots:{default:[create_default_slot_3]},$$scope:{ctx:t}}}),o=new t[48]({props:{danger:!0,outline:!0,$$slots:{default:[create_default_slot_2]},$$scope:{ctx:t}}}),o.$on("click",t[115]),{c(){create_component(e.$$.fragment),n=space(),r=element("div"),create_component(o.$$.fragment),attr(r,"class","flex_div svelte-lfqa43")},m(t,a){mount_component(e,t,a),insert(t,n,a),insert(t,r,a),mount_component(o,r,null),i=!0},p(t,n){const r={};512&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r);const i={};134217728&n[6]&&(i.$$scope={dirty:n,ctx:t}),o.$set(i)},i(t){i||(transition_in(e.$$.fragment,t),transition_in(o.$$.fragment,t),i=!0)},o(t){transition_out(e.$$.fragment,t),transition_out(o.$$.fragment,t),i=!1},d(t){destroy_component(e,t),t&&detach(n),t&&detach(r),destroy_component(o)}}}function create_title_icon_slot(t){let e,n,r;return n=new AlertTriangleIcon({props:{size:"25"}}),{c(){e=element("div"),create_component(n.$$.fragment),attr(e,"slot","title-icon")},m(t,o){insert(t,e,o),mount_component(n,e,null),r=!0},p:noop,i(t){r||(transition_in(n.$$.fragment,t),r=!0)},o(t){transition_out(n.$$.fragment,t),r=!1},d(t){t&&detach(e),destroy_component(n)}}}function create_default_slot$1(t){let e,n;return e=new t[46]({props:{title:"Speichern nicht erfolgreich",danger:!0,$$slots:{"title-icon":[create_title_icon_slot],default:[create_default_slot_1]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,n){const r={};768&n[0]|134217728&n[6]&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function create_fragment$1(t){let e,n,r,o,i,a,s,c,l,d,u,h,m;document_1.title=e=t[44];let f={ctx:t,current:null,token:null,hasCatch:!1,pending:create_pending_block,then:create_then_block,catch:create_catch_block,value:206,blocks:[,,,]};function p(e){t[110](e)}handle_promise(t[66](),f);let _={$$slots:{default:[create_default_slot_11,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};void 0!==t[13]&&(_.open=t[13]),o=new t[45]({props:_}),binding_callbacks.push(()=>bind(o,"open",p));let g=t[23]&&t[24]&&create_if_block(t);function w(e){t[114](e)}let $={$$slots:{default:[create_default_slot_4,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};function y(e){t[116](e)}void 0!==t[41]&&($.open=t[41]),c=new t[45]({props:$}),binding_callbacks.push(()=>bind(c,"open",w));let b={$$slots:{default:[create_default_slot$1,({closeCallback:t})=>({202:t}),({closeCallback:t})=>[0,0,0,0,0,0,t?65536:0]]},$$scope:{ctx:t}};return void 0!==t[8]&&(b.open=t[8]),u=new t[45]({props:b}),binding_callbacks.push(()=>bind(u,"open",y)),{c(){n=space(),f.block.c(),r=space(),create_component(o.$$.fragment),a=space(),g&&g.c(),s=space(),create_component(c.$$.fragment),d=space(),create_component(u.$$.fragment)},m(t,e){insert(t,n,e),f.block.m(t,f.anchor=e),f.mount=()=>r.parentNode,f.anchor=r,insert(t,r,e),mount_component(o,t,e),insert(t,a,e),g&&g.m(t,e),insert(t,s,e),mount_component(c,t,e),insert(t,d,e),mount_component(u,t,e),m=!0},p(n,r){t=n,(!m||8192&r[1])&&e!==(e=t[44])&&(document_1.title=e),update_await_block_branch(f,t,r);const a={};134283264&r[6]&&(a.$$scope={dirty:r,ctx:t}),!i&&8192&r[0]&&(i=!0,a.open=t[13],add_flush_callback(()=>i=!1)),o.$set(a),t[23]&&t[24]?g?(g.p(t,r),25165824&r[0]&&transition_in(g,1)):(g=create_if_block(t),g.c(),transition_in(g,1),g.m(s.parentNode,s)):g&&(group_outros(),transition_out(g,1,1,()=>{g=null}),check_outros());const d={};2048&r[1]|134283264&r[6]&&(d.$$scope={dirty:r,ctx:t}),!l&&1024&r[1]&&(l=!0,d.open=t[41],add_flush_callback(()=>l=!1)),c.$set(d);const p={};768&r[0]|134217728&r[6]&&(p.$$scope={dirty:r,ctx:t}),!h&&256&r[0]&&(h=!0,p.open=t[8],add_flush_callback(()=>h=!1)),u.$set(p)},i(t){m||(transition_in(f.block),transition_in(o.$$.fragment,t),transition_in(g),transition_in(c.$$.fragment,t),transition_in(u.$$.fragment,t),m=!0)},o(t){for(let t=0;t<3;t+=1){transition_out(f.blocks[t])}transition_out(o.$$.fragment,t),transition_out(g),transition_out(c.$$.fragment,t),transition_out(u.$$.fragment,t),m=!1},d(t){t&&detach(n),f.block.d(t),f.token=null,f=null,t&&detach(r),destroy_component(o,t),t&&detach(a),g&&g.d(t),t&&detach(s),destroy_component(c,t),t&&detach(d),destroy_component(u,t)}}}let gList=new Map,gTask=new Map,gTaskFull=new Map;const setList=(t,e)=>gList.set(t,e),getList2=t=>gList.get(t),getList=async(t,e)=>{const n="p$"+t+"$"+e,r=gList.get(n);if(r?.length)return r;const o=e;return gList.has(o)||(gList.set(o,[]),gList.set(o,Request.getTasksList(e).then(({data:t})=>t))),gList.get(o)},getTask=async(t,e,n,r=!1)=>{let o=gTask.get(n);if(!o)if(r)o=Request.getTaskList(t,n),gTask.set(n,o);else{const r="p$"+t+"$"+e,i=await gList.get(r);if(!i?.length)return getList(t,e).then(e=>(o=e.find(({_id:t})=>t===n),o||(o=Request.getTaskList(t,n)),gTask.set(n,o),o));o=i.find(({_id:t})=>t===n),o||(o=Request.getTaskList(t,n)),gTask.set(n,o)}return o},addTask=(t,e,n)=>{if(!gList.get(t))return;const r=e;gTask.set(r,n)},setTaskSelection=(t,e)=>{gTaskFull.set(t,e)},getTaskSelection=t=>gTaskFull.get(t),getTaskFull=(t,e,n=!1)=>{let r=!n&&gTaskFull.get(e);return r||(r=Request.getTask(t,e),gTaskFull.set(e,r)),r},refreshList=(t,e)=>{if(!gList.get(e))return;const n=e;gList.set(n,Request.getTasksList(e).then(({data:t})=>t))},resetCache=()=>{gList=new Map,gTask=new Map,gTaskFull=new Map};function sleep(t){return new Promise(e=>setTimeout(e,t))}function instance$1(t,e,n){let r,o,i,a,s,c,l,d;component_subscribe(t,taskClipboard,t=>n(134,s=t)),component_subscribe(t,settings,t=>n(135,c=t)),component_subscribe(t,currentRoles,t=>n(136,l=t));const{Modal:u,Dialog:h,Divider:m,Button:f,FormField:p,Checkbox:_,Chip:g}=getAttractions,{loggedIn:w,currentTasks:$,environment:y}=user;component_subscribe(t,w,t=>n(137,d=t)),component_subscribe(t,$,t=>n(132,i=t)),component_subscribe(t,y,t=>n(133,a=t)),JSON.parse(Storage.getItem("Locale"));const b=createEventDispatcher();let{schema:v}=e,{recID:I}=e,{deletable:C}=e,{prevEventID:E=!1}=e,{prev:A=!1}=e,{taskId:S=!1}=e,{taskOrg:k}=e,{description:T=""}=e,{root:R=!1}=e,{readonly:N}=e,{isStandalone:D}=e,{shortEdit:x=!1}=e,{shortSchema:O=!1}=e,M=!0,P=!1,B="",F=window.location.href.split("/task/")[2];F&&(F=F.split(":")[1],F&&(F=F.split("?")[0])),x&&(v=O);let L,q,V,H,U,z,W={},j={},G="form-"+v.class+Math.floor(9e3*Math.random()+1e3).toString(),X=!1,Q=!1;const Y=R?"fEmbedded":"fTask",Z=R?"sEmbedded":"sTask";let K="CHF";const J=new Map;let tt,et,nt=0,rt=0,ot=0,it=0,at=1,st=!I&&v.list&&1===v.list.length;const ct={},lt=v.items.find(t=>"price"===t.name&&!t.properties?.hidden),dt=v.items.find(t=>"quantity"===t.name&&!t.properties?.hidden),ut=v.items.find(t=>"amount"===t.name&&!t.properties?.hidden),ht=!!lt||!!ut,mt=v.list?.filter(t=>"array"===t.type)?.length>1||v.items?.filter(t=>t.name.startsWith("amount"))||ht,ft=v.items.find(t=>"number"===t.type&&"w"===t.properties?.unit?.constant?.toLowerCase()&&!t.properties?.hidden)?.name,pt=!!ft,_t=v.list?.filter(t=>"array"===t.type)?.length>1||pt,gt={},wt=v.result?.resultDef[0].button?.description;let $t,yt,bt,vt,It,Ct,Et,At,St,kt,Tt,Rt,Nt,Dt="",xt="",Ot="",Mt=!1,Pt=!1,Bt=!1,Ft=!1,Lt=!1,qt=0,Vt=0,Ht=[],Ut=[],zt=[],Wt={},jt=new Map,Gt=v.class,Xt=v.id,Qt=!1,Yt=-1!==window.location.search.indexOf("next="),Zt=0;const Kt=-1!==window.location.search.indexOf("back=true");St=At=!i?.length||i.find(t=>t===Xt);["readonly","hidden","required"].map(t=>{v.items.filter(e=>"object"==typeof(e.properties&&e.properties[t])).map(e=>{const n=e.properties[t].refItem||"",[r,o]=n.split(".");Ht.push({action:t,itemName:e.name,refObj:r,refName:o,op:e.properties[t].invert?"!":""})})});v.items.filter(t=>t.selection&&t.constraint).map(t=>{Ut.push({name:t.name,selection:t.selection,constraint:t.constraint})});v.items.filter(t=>t.lookup).forEach(t=>{zt.push({name:t.name,lookup:t.lookup})}),v.items.filter(t=>t.properties?.lookup).forEach(t=>{zt.push({name:t.name,lookup:t.properties.lookup.split(":").at(-1)})});const Jt=async t=>{if(t?.length)for(const e of t){if(!e.lookup)break;const{name:t}=e;if(W[t])break;const{domain:r,value:o}=e.lookup;if("user"===r&&o){const e=d.user,r={[o]:e},i=await Request.getSectionView(t,r);if(i?.length){const[{_id:e}]=i;e&&n(10,W[t]=e,W)}}}},te=async t=>{if(!v.input)return;if(!v.input.length)return;if(v.input.length<2)return;const e=!t.input.class[0].name&&t.input.class[0].selection;if(!e)return;const r=t.input.class[1].name,[o,i]=t.input.class[1].destination?.split(".");if(!r||!i)return;const a=v.list?.find(t=>t.name===o);if(!a)return;if(a.filter)return;const s=await Request.getSchemaByClass(e),c=(await Request.getTasks(s.id)).data;if(!c?.length)return;const l=[];for(const t of c)if(t.active??1){const e={};for(const n of a.item)n.name===i?e[n.name]=t._id:t[n.name]&&(e[n.name]=t[n.name]);l.push(e)}l.length&&n(10,W[o]=l,W)},ee=async t=>{if(!v.input)return;if(!v.input.length)return;if(v.input.length>1)return;const e=Ct.input.class[0],{name:n,selection:r,state:o,list:i}=e;n||r&&o&&i&&await ne(r,o,i)},ne=async(t,e,r)=>{const o=(await Request.getEvents()).filter(e=>e.output?.class?.at(0)?.name===t),i={[r]:[]};for(const n of o){let o={event:n._id,status:e};const a=await Request.getSectionView("_task",o);if(a?.length){o={_id:{$in:a.map(t=>t.docId)}};const e=await Request.getSectionView(t,o);for(const n of e){const e=v.list.find(t=>t.name===r);if(e){const o={[t]:n._id.toString()};for(const t of e.item)n[t.name]&&(o[t.name]=n[t.name]);i[r].push(o)}}}}setTimeout(()=>n(10,W={...W,...i}),100)},re=()=>{for(const t of v.items)"boolean"==typeof t.properties?.value&&n(10,W[t.name]=t.properties.value,W),"string"==typeof t.properties?.value&&n(10,W[t.name]=t.properties.value,W),t.properties?.value?.concatenation&&ie(t);oe()},oe=async()=>{for(const t of v.list||[])for(const e of t.item)if(e.refItem&&"array"!==t.type)if("owner"===e.refItem){const r=a.owner;r||set_store_value(y,a.owner=r=(await Request.getSolitaire(e.refItem))[0],a),a.owner||(await Request.getSolitaire(e.refItem))[0],r&&(W[t.name]||n(10,W[t.name]={},W),n(10,W[t.name][e.name]=getData(r,e.refPos||e.name),W))}else if(W[e.refItem]){const r=await Request.getTask(e.refItem,W[e.refItem]);r&&(W[t.name]||n(10,W[t.name]={},W),n(10,W[t.name][e.name]=getData(r,e.refPos||e.name),W))}},ie=async t=>{const e=t.properties.value.concatenation;let r="";for(const t of e)void 0!==t.constant&&(r+=t.constant),"year"===t.variable&&(r+=(new Date).getFullYear()),t.refItemNext&&(r+=await se(t.refItemNext));n(10,W[t.name]=r,W)},ae=async t=>{const e=Ht.filter(e=>e.refObj===t||e.itemName===t);if(e?.length){n(32,Wt={});for(const t of e){const{itemName:e,refObj:r,refName:o,op:i}=t;let{action:a}=t;if(!r)break;let s,c,l=!o&&W[r];const d=W[r];d&&o&&(l=(await getTaskFull(r,d))[o]),Array.isArray(l)&&0===l.length&&(l=!1),"!"===i&&(l=!l),"required"!==a&&"readonly"!==a||(a="required"===a?a:"disabled",setTimeout(()=>{s=`#${G} .form-field.${e} .field #${e}`,c=document.querySelector(s),c&&l&&c.setAttribute(a,""),c&&!l&&c.removeAttribute(a)},0)),"hidden"===a&&(s=`#${G} .form-field.${e}`,c=document.querySelector(s),c?.classList?.toggle("hidden",!!l),l&&n(32,Wt[e]="",Wt))}}},se=async t=>{const[e,n]=t.offset?.split(",")||[0,0],r=+t.base||0,o=+t.step||1;t.type;const i=t.refItem,a=await Request.getLastId(v.class,i);if(!a?.length)return(r+o).toString().padStart(n,"0");let s=a[0][i];+s<r&&(s=r.toString());return((+s?.substring(e,e+n)||r)+o).toString().padStart(n,"0")},ce=(t,e,n,r=!1)=>{const o=n||e.name,i=o.startsWith("_")?o:o.split("_")[0],a=t.find(t=>t.name===i);let s=e.value;if(!a)return s;if(r||"signature"!==a.type&&!a.properties?.multi||W[o]&&!s&&(s=W[o]),"dateRange"===a.type){if(null===s)return;let t=new Date(s);if("Invalid Date"==t)return;return t=`${t.getFullYear()}-${(t.getMonth()+1).toString().padStart(2,"0")}-${t.getDate().toString().padStart(2,"0")}T00:00:00.000Z`,new Date(t).toISOString()}if(s&&a.type.startsWith("date"))try{return parseDateTime(s,"%d.%m.%Y").toISOString()}catch{return new Date(s).toISOString()}if("boolean"===a.type&&(s=!!e.checked),"number"===a.type){const t=a.properties?.decimals||0;try{s=Number(s.replace(",",".")).toFixed(t).toString()}catch{}}if(r&&"date"===a.type&&a.properties?.required&&!s&&W[o]){s=W[o];try{return parseDateTime(s,"%d.%m.%Y").toISOString()}catch{return s}}return s},le=async t=>{n(43,r=!0);const e=t.submitter?.className?.includes("close"),o={_docAsync:t?._docAsync};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map(t=>{if(t.name)if(t.name.includes(".")){const e=t.name.split(".")[0],n=v.items.find(t=>t.name===e);if(n&&"object"===n.type&&n.properties?.multi)o[e]=(o[e]||[]).concat(t.value);else{const[e,n]=t.name.split("."),r=v.list.find(t=>t.name===e);o[t.name]=ce(r.item,t)}}else o[t.name]=ce(v.items,t);else if(t.id){"signature"===v.items.find(e=>e.name===t.id).type&&(t.name=t.id,o[t.name]=ce(v.items,t))}});let i=!1;if(v.list&&v.list.map(t=>{if(t.mandatory){const e=j[t.name]?.filter(t=>!t._delete).length;if(!e||e<2)return void(i=!0)}"array"===t.type&&j[t.name]&&(t.item.forEach(e=>{for(const n of j[t.name])void 0===n[e.name]&&(n[e.name]="boolean"!==e.type&&"")}),o[t.name]=j[t.name].reduce((e,n)=>n._delete||!Object.values(n).some(Boolean)?e:e.concat(Object.entries(n).reduce((e,[n,r])=>("_delete"!==n&&(e[n]=ce(t.item,{name:n,value:r,checked:r},"",!0)),e),{})),[]))}),i)return toasts.failed("Bitte Positionen erfassen",3e3),void n(43,r=!1);if(o._event=Xt,o._prevEventId=E,o._taskId=S,H){const t=H.record;for(const e in t)e.includes(".")&&delete t[e];t._event=H.event,t._taskId=H.taskId;const{id:e}=await Request.saveData(H.class,t);o[H.class]||(o[H.class]=e)}if(x)return de(v.class,o),n(43,r=!1),he();const{id:a,task:s,tax:c,error:l,state:d,info:u}=await Request.saveData(v.class,o);if(l?.text){const t=l.field?" in "+l.field+": "+l.value:"";if(n(9,B=`${l.text} ${t}`),n(8,P=!0),!d)return void n(43,r=!1)}if(Rt){const t=new FormData;t.append("title",Rt.fileName),t.append("file",Rt.file),await Request.uploadUserReport(s,t)}u&&!Array.isArray(u)&&u.accepted?u.accepted?.length?toasts.success(`Email versandt an ${u.accepted.join(", ")}, Dateigrösse: ${u.messageSize} Bytes.`,5e3):(n(9,B="Email konnte nicht versandt werden!"),n(8,P=!0)):toasts.success("Die Daten wurden gespeichert.",2e3),n(43,r=!1),n(18,rt=c?._amount||0),n(19,ot=100*(c?._rate||0)||""),ge(),o._id=a;const h=await Request.getTaskList(v.class,a);if(b("choose",{row:h}),e)return n(43,r=!1),he();if(!I){if(Yt){const t=Math.floor(9e3*Math.random()+1e3).toString();return window.singleSpaNavigate(`/task/${Xt}/${Xt}/task?next=${t}`)}return window.singleSpaNavigate(`/task/${Xt}/${s}/task`)}},de=async(t,e)=>{if(!x.lookup)return;const n={};for(const t in e){const r=e[t];Array.isArray(r)||x.lookup.includes(t)&&(n[t]=e[t])}const r=await Request.getSectionView(v.class,n);if(!r?.length)return void await Request.saveData(t,e);let o,i;for(const n of r.toReversed()){if(!(await Request.getTaskByDocId(n._id,!0)).status.startsWith("WaitingForApproval"))continue;i=n;const r=n[x.ref];for(let i=0;i<r.length;i++){o=!0;const a=r[i];for(const t in a)if(x.lookup.includes(t)&&a[t]!=e[x.ref][0][t]){o=!1;break}if(o)return r[i]=e[x.ref][0],n._event=e._event,n._prevEventId=e._prevEventId,n._taskId=e._taskId,void await Request.saveData(t,n)}}if(i){const n=i;n[x.ref].push(e[x.ref][0]),n._event=e._event,n._prevEventId=e._prevEventId,n._taskId=e._taskId,await Request.saveData(t,n)}else await Request.saveData(t,e)},ue=()=>x||V||D||!E?he():window.history.back(),he=()=>Kt?b("back"):D?window.close():R?window.singleSpaNavigate("/"):b("back"),me=async({detail:t})=>{if(Array.isArray(t.value)&&J.set(t.name,t.value),!(v.input?.length&&v.input.length>1))return;if(L?.class!==v.input[0]&&!F)return;let e,{value:r,lookup:o,name:i,view:a}=t;if(!o&&!F)return;if(o&&(e=o.split(":")[0]),a||(e=i,a="_id"),F){if(e=v.input[1],!J?.size||!J.get(t.name)?.length)return void n(10,W[e]=[],W);a=i,r=[F]}const s=await Request.getSectionView(e,{[a]:{$in:r}}),c=s.map(t=>t._id);for(const t of v.input.slice(1)){n(10,W[t]=[],W);const r=await Request.getSchemaByClass(t);r.id;let o=await Request.getTasks(r.id);if(o=o.data.filter(t=>"Ready"===t._task?.status&&(c.includes(t[e])||c.includes(t._id))),o?.length){const{filter:r}=Ct.input.class.find(e=>e.name===t),{refItem:i,value:a}=r||{},c=[];if(o.forEach(t=>{if(r){const n=s.find(n=>n._id===t[e]);n&&n[i]===a&&c.push(t._id)}else c.push(t._id)}),c.length){const e=await Request.getSectionView(t,{_id:{$in:c}});for(const n of e)n[t]=n._id;n(10,W[t]=e,W)}}}},fe=async(t,e,r)=>{if(1===Ct.input?.class?.length){const n=Ct.input.class[0],{name:r,selection:o,state:i,list:a,exclude:s}=n;t===r&&o&&i&&a&&await pe(t,e,o,i,a,s)}if(v.input&&v.input.length>1&&!F){if(v.input[0]!==t)return;const{name:o,source:i,destination:a,selection:s}=Ct.input.class[1];if(i&&a){const r=await getTaskFull(t,e);if(!r)return void n(10,W[a]=[],W);const o=await getTaskFull(s,r[s]);if(!o)return;const c=o[i]||[];return void n(10,W[a]=c,W)}const{recursive:c}=Ct.input.class[1];if(e){let o=await Request.getTaskOptions(`${t}:${e}`,Xt,c);if(r){const t=a.split(".")[1],e=[];o[t].forEach(n=>{W[t]?.find(e=>e[t]===n[t])||e.push(n)}),o={[t]:W[t]?[...W[t],...e]:[...e]}}n(10,W={...W,...o})}else{const t=v.input.slice(1);for(const e of t)n(10,W[e]=[],W)}}for(const t of Ct.output.class[0].item)"date"===t.type&&t.properties?.value?.formula?Ae(t.name):void 0!==t.factor&&n(10,W[t.name]=W[t.name]*t.factor,W);if((async()=>{const t=v.items.find(t=>"textarea"===t.properties?.format&&t.properties?.source);if(t&&!W[t.name]){const e=new Set;let r="";for(const n of t.properties.source){const[t,o,i]=n.split("."),a=W[t];for(const n of a||[]){const a=n[o];if(a&&!e.has(a)){e.add(a);const n=v.list?.find(e=>e.name===t),s=n?.item.find(t=>t.name===o);if(s?.refClass){const t=await getTaskFull(s.refClass,a);t&&t[i]&&(r+=t[i])}}if(r)break}if(r)break}r&&n(10,W[t.name]=r,W)}})(),v.list?.length){let t=At;for(const e of v.list)"array"===e.type&&e.mandatory&&W[e.name]&&!W[e.name].length&&(t=!1);n(38,St=t)}},pe=async(t,e,n,r,o,i)=>{n=[].concat(n);for(const a of n)await _e(t,e,a,r,o,i)},_e=async(t,e,r,o,i,a)=>{let[s,c]=r.split(".");c||(c=r,s=""),i=[].concat(i);const l=s?(await Request.getEvents()).filter(t=>t.output?.class?.at(0)?.name===c):(await Request.getEvents()).filter(t=>t.output?.class?.at(0)?.name===c&&Ct.output?.class?.at(0)?.list?.find(e=>e.name===t.identity.name)),d={};for(const n of l)if(d[n.identity.name]=[],e){let r={event:n._id,status:o};const l=await Request.getSectionView("_task",r);if(l?.length){const o=[];r={_id:{$in:l.map(t=>t.docId)},[t]:e};const u=await Request.getSectionView(c,r);for(const t of u)for(const e of i)if(e.startsWith("$")){const n=e.slice(1),r=[];for(const e of t[n]||[]){const n={...e,[c]:t._id};for(const t in n)!n.quantity&&t.startsWith("quantity")&&(n.quantity=n[t]);n.quantity&&r.push(n)}let o=d[n]||[];o=o.concat(r),d[n]=o}else if(s){let n=!0;if(a){const r=await Request.getSectionView(v.class,{[e+"."+c]:t._id});n=!r?.length}const r={[c]:t._id.toString()};n&&o.push(r)}else for(const n of t[e]||[]){const e={...n,[c]:t._id};for(const t in e)!e.quantity&&t.startsWith("quantity")&&(e.quantity=e[t]);e.quantity&&o.push(e)}s?d[i[0]]=o.length?o:[]:d[n.identity.name]=o.length?o:[]}}else s&&(d[i[0]]=[]);setTimeout(()=>n(10,W={...W,...d}),100)},ge=()=>{let t=0;if(lt){let e=1;dt&&(e=at),t=it*e}ut&&(t=it);let e=0;for(const t in ct)e+=ct[t];let r=0;for(const t of v.items)t.name.startsWith("amount")&&(r+=+W[t.name]);n(17,nt=e+t),W.discount>0&&n(17,nt-=nt*W.discount*.01),n(17,nt+=r)},we=()=>{let t=0;for(const e in gt)t+=gt[e];n(31,qt=t+ +Vt)},$e=({detail:t})=>{j[t.listName]=t.value,mt&&(ct[t.listName]=t.amountValue,ge()),_t&&(gt[t.listName]=t.weeksValue||0,we()),t.addToRecord&&n(12,U=t)};task_notification.subscribe(async t=>{if(!t)return;if(!I)return;const e=await Request.getSchema(t.eventId);if(!e)return;const r=v.list?.find(t=>t.name===e.class);if(!r)return;const o=await Request.getTaskById(t.taskId);addTask(o.event,o.docId,o.data);const i=await Request.getTask(e.class,o.docId),a=W[e.class].filter(t=>t[e.class]==i._id);a?.length&&a.map(t=>{t[e.class]=o.docId}),n(10,W),n(104,q),n(103,L),n(0,v)}),onMount(async()=>{if(resetCache(),await be(),!x)return;const t={...W};let e=t[x.ref][0];for(const t in e)e[t]||(e[t]=x.value[t]);const r={};for(const n in t){const o=t[n];if(Array.isArray(o))for(const t in e){const n=e[t];x.lookup.includes(t)&&(r[x.ref+"."+t]=n)}else x.lookup.includes(n)&&(r[n]=o)}if(x.lookup.includes("date")){const t=new Date,e=new Date(t.getFullYear(),t.getMonth(),t.getDate()).toISOString(),n=new Date(t.getFullYear(),t.getMonth(),t.getDate()+1).toISOString();r.date=e,r.date={$gte:e,$lt:n}}const o=await Request.getSectionView(v.class,r);let i=!1;for(const t of o){if((await Request.getTaskByDocId(t._id,!0)).status.startsWith("WaitingForApproval")){if(i)break;for(const n of t[x.ref]){let t=!0;for(const r in n)if(x.lookup.includes(r)&&n[r]!=e[r]){t=!1;break}if(t){for(const t in n)x.lookup.includes(t)||(e[t]=n[t]);i=!0;break}}}}n(10,W[x.ref][0]=e,W);const a=(x.focus||x.fill.at(-1))+"-0",s=document.getElementById(a);s&&s.focus()});const ye=async()=>{$t&&(yt||(yt=await Request.getEvent(Xt)),n(37,Yt=!0),$t.autostart&&De())},be=async()=>{const t=t=>new Promise(e=>setTimeout(e,t));let e,n=0;for(;!(e=document.getElementById(G)&&!Ft&&!Lt)&&++n<20;)await t(50);e||(e=document.getElementById(G)),e&&(()=>{if(I)return;const t=new Set;for(const e of Ht)t.add(e.refObj||Gt);Array.from(t).forEach(t=>ae(t))})(),ve()},ve=()=>{setTimeout(()=>{Array.from(jt).forEach(([t,e])=>{W[t]||n(10,W[t]=e._id,W)})},350)};onDestroy(()=>{I&&set_store_value(taskClipboard,s={[I]:{record:W,lists:j}},s)});const Ie=()=>{const t={};Array.from(document.querySelectorAll("form#"+G+" ."+G)).map(e=>{if(e.name){const n=v.items.find(t=>t.name===e.name.split(".")[0]);if(n?.properties?.multi){const n=e.name.split(".")[0];t[n]=(t[n]||[]).concat(e.value)}else if(e.name.includes(".")){const[n,r]=e.name.split("."),o=v.list.find(t=>t.name===n);t[e.name]=ce(o.item,e)}else t[e.name]=ce(v.items,e,e.name.split("_")[0])}}),v.list&&v.list.map(e=>{"array"===e.type&&j[e.name]&&(t[e.name]=j[e.name].reduce((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce((t,[n,r])=>("_delete"!==n&&(t[n]=ce(e.item,{name:n,value:r,checked:r},"",!0)),t),{})),[]))});let e=!0;return Object.entries(t).map(([t,n])=>{t=t.split("_")[0];const r=v.items.find(e=>e.name===t);r?.properties?.required&&!n&&(e=!1)}),e&&t},Ce=async t=>{let e;for(n(42,Zt=0),Re();!e&&Nt;){n(42,Zt++,Zt);const r=await Request.progressReport(t);if(e=r?.progressValue,Zt>300)break;await sleep(1e3)}if(Ne(),e){const e="/api/report/list/"+t;window.open(e,"_self","width=1 height=1")}},Ee=(t,e)=>("number"==typeof t&&t||(t=Number(t||0)),t.toFixed(e||0)),Ae=async t=>{if(!t)return;const e=v.items.find(e=>e.name===t),r=e.properties.value.formula,{operator:o,argument:i}=r,a=i.map(t=>W[t.refItem]);let s=0;if("$add"===o){if("date"===e.type)return void n(10,W[t]=await Se(o,i),W);s=a.reduce((t,e)=>+(t||0)+ +(e||0))}if("$subtract"===o&&(s=a.reduce((t,e)=>{t||(t=""),e||(e="");const[n,r]=t.toString().split(":");t=r?(+n+ +r/60).toFixed(2):+(n||0);let[o,i]=e.toString().split(":");return o||(o=0),t-=i?(+o+ +i/60).toFixed(2):+(o||0)})),"$multiply"===o&&(s=a.reduce((t,e)=>+(t||0)*+(e||0))),"$percentMultiply"===o){const[t,e]=a;if(!+t)return;s=+t,+e>0&&(s*=1-e/100)}if("$percentDivide"===o){const[t,e]=a;if(!+t||!+e)return;s=+t/+e*100}n(10,W[t]="$multiply"===o?s?Ee(s,e.properties?.decimals):"":Ee(s,e.properties?.decimals),W)},Se=async(t,e)=>{const[n,r]=e.map(t=>t.refItem||t.value);let o,i;"string"==typeof r&&([o,...i]=r.split("."),0===i.length?(i=o,o=""):i=i.join("."));const s=ke(W[n])||Date.now();let c=i?0:r;if(o){if("owner"===o)a.owner||set_store_value(y,a.owner=await Request.getSectionView("owner",{}),a),c=getData(a.owner,i);else if(W[o]){const t=await getTaskFull(o,W[o]);t&&(c=getData(t,i))}}else c=c||W[i];return addDays(s,c||0)},ke=t=>{if(!t)return;let e,n,r;t.includes("T")?([e,n,r]=t.split("-"),r=r.split("T")[0]):[r,n,e]=t.split(".");return new Date(+e,+n-1,+r).toISOString()},Te=()=>{n(13,X=!1)},Re=()=>{n(41,Nt=!0)},Ne=()=>{n(41,Nt=!1)},De=()=>{n(29,Pt=!1),n(26,xt=""),n(25,Dt=""),n(27,Ot=""),n(24,bt=!0)},xe=()=>{n(25,Dt=""),n(26,xt=""),n(27,Ot=""),n(29,Pt=!1),n(28,Mt=!0),Oe()},Oe=()=>{if(!$t.keyboard)return;const t=document.getElementById("reader_focusId");t&&t.focus()};return t.$$set=t=>{"schema"in t&&n(0,v=t.schema),"recID"in t&&n(2,I=t.recID),"deletable"in t&&n(3,C=t.deletable),"prevEventID"in t&&n(99,E=t.prevEventID),"prev"in t&&n(4,A=t.prev),"taskId"in t&&n(1,S=t.taskId),"taskOrg"in t&&n(100,k=t.taskOrg),"description"in t&&n(97,T=t.description),"root"in t&&n(5,R=t.root),"readonly"in t&&n(98,N=t.readonly),"isStandalone"in t&&n(101,D=t.isStandalone),"shortEdit"in t&&n(6,x=t.shortEdit),"shortSchema"in t&&n(102,O=t.shortSchema)},t.$$.update=()=>{32&t.$$.dirty[3]&&n(43,r=N),1&t.$$.dirty[0]|3072&t.$$.dirty[3]&&q&&L&&(v.items.map(({name:t,type:e,refItem:r,properties:o})=>{if(!1===r)return;const i=L.items.find(e=>e.name===t);if(!i)return;if(e!==i.type)return;const a="_"+t;q[t]?n(10,W[t]=q[t],W):r&&r.startsWith("owner")||o&&o.readonly||n(10,W[t]="",W),q[a]&&n(10,W[a]=q[a],W),n(22,st=!1)}),(()=>{for(const t of v.list||[]){const e=[],r=W[t.name];if(r?.length){for(const n of r){const r=n;for(const e of t.item)if(!1===e.refItem)r[e.name]="boolean"!==e.type&&"";else if(e.refItem)if("date"!==e.type||W[e.refItem])r[e.name]=W[e.refItem];else{const t=new Date,n=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0);r[e.name]=n}e.push(r)}n(10,W[t.name]=e,W)}}})()),32&t.$$.dirty[0]|16&t.$$.dirty[3]&&n(44,o=R?T||"enablerr - Form":document.title)},[v,S,I,C,A,R,x,M,P,B,W,V,U,X,Q,z,K,nt,rt,ot,tt,et,st,$t,bt,Dt,xt,Ot,Mt,Pt,Ft,qt,Wt,vt,It,Qt,Et,Yt,St,kt,Tt,Nt,Zt,r,o,u,h,m,f,p,_,g,w,$,y,G,Y,Z,{name:"amountValue",properties:{decimals:2}},{name:"taxValue",properties:{decimals:2}},J,mt,_t,{name:"weekValue",properties:{decimals:1}},wt,Xt,async()=>{if(n(34,It=[]),a.owner||set_store_value(y,a.owner=await Request.getSectionView("owner",{}),a),a.currency?n(16,K=a.currency.designation):Request.getSectionView("owner",{}).then(t=>{t?.length&&t[0].currency&&getTaskFull("currency",t[0].currency).then(t=>{t&&n(16,K=t.designation)}).catch(t=>console.log("currency not found"))}),W.currency&&getTaskFull("currency",W.currency).then(t=>{t&&n(16,K=t.designation)}).catch(t=>console.log("currency not found")),Ct=await Request.getEvent(Xt),x&&n(10,W[x.ref]=[{...x.value}],W),!I){if(n(33,vt=It),Jt(Ct.input?.class).then(()=>{Lt=!0}),re(),te(Ct),ee(),F){const t=Ct.input.class[0].selection;W[t]||(n(10,W[t]=[F],W),me({detail:{value:[F],name:t}}))}await(async()=>{if(!r&&(yt||(yt=await Request.getEvent(Xt)),n(23,$t=yt.output.class[0].reader),$t&&!$t.keyboard))try{const t=await getCameras();t?.length||n(23,$t=!1)}catch{}})(),ye()}if(I){if(s&&s[I]){const t=s[I],e=t.record;v.items.map(t=>{e[t.name]=ce(v.items,{name:t.name,value:e[t.name],checked:e[t.name]})}),n(10,W=e),v.list&&v.list.map(e=>{"array"===e.type&&t.lists[e.name]&&n(10,W[e.name]=t.lists[e.name].reduce((t,n)=>n._delete||!Object.values(n).some(Boolean)?t:t.concat(Object.entries(n).reduce((t,[n,r])=>("_delete"!==n&&(t[n]=ce(e.item,{name:n,value:r,checked:r},"",!0)),t),{})),[]),W)})}else n(10,W=await Request.getTask(v.class,I));if(n(97,T=getRecordDescription(v,W)),v.result,n(35,Qt=!!v.result?.resultDef&&!v.result.resultDef[0].createAfterSave),n(18,rt=W._tax?._amount),n(19,ot=100*W._tax?._rate||""),n(40,Tt=v.list?.find(t=>t.mandatory)&&Ct.input?.class?.length>1),Tt){(k||await Request.getTaskByDocId(I,!0)).visum&&n(40,Tt=!1)}n(12,U={itemName:v.class,value:I})}if(E){n(98,N=!1),n(103,L=await Request.getSchema(E)),"string"==typeof A&&n(104,q=await Request.getTask(L.class,A));const t=v.items.find(t=>t.refClass===L.class);t&&n(10,W[t.name]=q._id,W)}if(_t&&(Vt=W[ft]||0),Ct.trigger?.startOn&&!Ct.trigger.startOn.some(t=>t.type.indexOf("Manual")>=0)&&n(98,N=!0),c.role?.length&&v.authorization?.length){const t=v.authorization.some(t=>l?.find(e=>e===t.role&&"edit"===t.activity));n(98,N||=!t)}if(n(11,V="report"===Ct.output.type),n(7,M=!1!==Ct.output.class?.at(0)?.documentTotal),n(39,kt=Ct.output.saveButton),a.userSetting){const t=a.userSetting;if(n(36,Et=t.isAdmin),!Et){const t=d.tenants.find(t=>t._id===d.tenant);t&&n(36,Et=t.admin?.find(t=>t===d.user))}}else Request.getUserSettings().then(t=>{if(n(36,Et=t.isAdmin),!Et){const t=d.tenants.find(t=>t._id===d.tenant);t&&n(36,Et=t.admin?.find(t=>t===d.user))}});return n(30,Ft=!0),!0},le,ue,async({detail:t})=>{const{row:e}=t;let{eventId:r}=t;if((()=>{if(I)for(const t of Ht)t.refName||ae(t.itemName)})(),await(async(t,e)=>{if(!t&&!e?._id)return;let r,o=!1;const i={...W};for(const n of v.items){if("string"==typeof n.refItem&&(!t||n.properties?.linkOnly)){const[t,s]=n.refItem.split(".");if("owner"===t)n.refItem.split(".").length<3&&(i[n.name]=a.owner[s||n.refClass],o=!0);else if(n.refInput?.includes("|")&&W[t]){const[e,a]=n.refInput.split("|");r=await getTaskFull(t,W[t]),i[n.name]=r[e]||r[a]||"",o=!0}else if(W[t]){if((e._id===W[t]||n.refItemAlt)&&(r=await getTaskFull(t,W[t]),r)){let t;24===r[s]?.toString().length?(r=await getTaskFull(s,r[s]),r&&(t=r[n.name||n.refInput])):s?(t=r[s][n.name]||r[s],"object"==typeof t&&(t=void 0)):t=r[n.name],void 0!==t&&(i[n.name]=t,o=!0)}}else s&&(i[n.name]="",o=!0)}if(!i[n.name]&&"string"==typeof n.refItemAlt&&(!t||n.properties?.linkOnly)){const[t,a]=n.refItemAlt.split(".");if((W[t]||e[t])&&(r=await getTaskFull(t,W[t]||e[t]),r)){let t;24===r[a]?.toString().length?(r=await getTaskFull(a,r[a]),r&&(t=r[n.name||n.refInput])):t=a?r[a][n.name]||r[a]:r[n.name],void 0!==t&&(i[n.name]=t,o=!0)}}}for(const e of v.list||[])if((!t||e.properties?.linkOnly)&&e.refItem&&W[e.refItem]){r=await getTaskFull(refItem,W[e.refItem]);const t=[];for(const n of r[e.name]){const r={};for(const t of e.item)n[t.name]&&(r[t.name]=n[t.name]);t.push(r),o=!0}i[e.name]=t}o&&n(10,W=i)})(!!I,e),I)return;if(r||=e._task?.event,r&&(await(async(t,e)=>{if(!t)return;const r=(await Request.getEvent(t)).output.class[0].name,o=zt.filter(t=>t.lookup===r);if(o?.length)for(const t of o){const{lookup:r,name:o}=t;let i="";if(e){let t=await getTaskFull(r,e);t&&t[o]?.length&&(i=t[o][0][o])}i&&n(10,W[o]=i,W)}})(r,e._id),v.items.filter(t=>t.properties?.lookup).forEach(async t=>{const e=await Request.getEvent(r);e.output.class[0]?.name===t.properties.lookup&&n(10,W[t.name]="",W)})),!e._task)return;const o=e._task.event,i=await Request.getEvent(o);for(const t of Ct.output.class[0].item)"date"===t.type&&t.properties?.value?.formula&&Ae(t.name);if(!Ct.output?.class?.length)return;const s=Ct.output.class[0]?.item.find(t=>(t.refClass||t.name)===i.output.class[0]?.name);(Ct.input?.class?.length&&Ct.input.class[0].name===i.output.class[0]?.name||s?.asInput)&&(n(103,L=await Request.getSchema(o)),n(99,E=o),n(1,S=e._task._id),S&&e._task.docId?n(104,q=await Request.getTask(L.class,e._task.docId)):n(104,q={}),await fe(L.class,e?._task?.docId||e?._task?._id))},async({detail:t})=>{if(!x&&(n(12,U=t),"quantity"===t.itemName&&n(21,et=W.quantity),"currency"===t.itemName&&t.value&&getTaskFull("currency",t.value).then(t=>{t&&n(16,K=t.designation)}).catch(t=>console.log("currency not found")),(async(t,e)=>{const r=Ut.filter(e=>e.selection===t||e.constraint===t);if(r?.length){n(20,tt=!1);for(const o of r){const{selection:r,constraint:i,name:a}=o;if(e)break;n(10,W[a]="",W),t===r&&n(20,tt=i);const s=W[r];if(s&&t===i){let t=await getTaskFull(r,s);const e=W[i];if(e?.length){const r=e[0].split(", ");t=t[i];let o="";for(const e of t)Object.values(e).map(t=>{r.includes(t)&&(o=e[a])});n(10,W[a]=o,W)}}}}})(t.itemName,t.oldValue===t.value),oe(),ae(t.itemName),_t&&ft&&(t.itemName===ft&&(Vt=+t.value),we()),ht&&mt)){if(t.itemName===lt?.name)it=t.value;else if(t.itemName===dt?.name)at=t.value;else{if(t.itemName!==ut?.name)return;it=t.value}ge()}},me,$e,t=>{"button"!==t.srcElement?.type&&"textarea"!==t.srcElement?.type&&13==t.which&&t.preventDefault()},t=>async()=>{const e=await Request.getReportDoc(t)||{},{userReportId:n,type:r}=e;if(!n)return;if("eps"===r)return void toasts.success("Die Datei wurde erstellt und im Anhang abgelegt.");const o="/api/userreport/"+n;if("ics"===r)return window.open(o,"_self","width=1 height=1");const i="/viewer/doc/index.html?file="+o+"&type="+r;window.open(i,"","popup=yes toolbar=no width=624 height=900")},t=>async()=>{const t=await Request.getDocData(S);(async t=>{const e=window.screen.height,n=window.open("","_blank","width=800,height="+e+",location=no");await tick(),n?.document.write("<title>Report Daten für '"+v.identity.designation+"'</title>"),n?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+t+"</textarea>")})(JSON.stringify(t,null,4),v.identity.designation)},async()=>{const t=Ie();if(!t)return;const e=Ct.result?.resultDef[0]?.addToReports;if(e){const n=t[e];if(n){const e={docId:n},r=(await Request.getSectionView("_task",e))[0];t._taskId=r._id}}const{reportId:n,type:r}=await Request.createReport(Xt,t);await Ce(n),he()},async()=>{const t=Ie();if(!t)return;const e=await Request.getReportData(Xt,t),n=window.screen.height,r=window.open("","_blank","width=800,height="+n+",location=no");await tick(),r?.document.write("<title>Report Daten für '"+v.identity.designation+"'</title>"),r?.document.write("<textarea readonly style='resize: none; width: 100%; height: 100%;'>"+JSON.stringify(e,null,4)+"</textarea>")},async({detail:{className:t,itemName:e,value:n}})=>{if(Gt!==n)return;if(!t)return;if(jt.has(t))return;if(!0!==n&&(n=(n=[].concat(n)).some(t=>t===Gt)),!n)return;const r={[e]:!0},o=await Request.getSectionView(t,r);o?.length&&jt.set(t,o[0])},({detail:t})=>{H=t},({detail:t})=>{t.target&&v.list?.length?n(15,z={ref:t.target,val:t.value}):t.itemName.startsWith("$")?Rt=t.value:setTimeout(()=>{n(10,W[t.itemName]=t.value,W)},200)},({detail:t})=>{n(14,Q=!1);for(const e of t.items)n(10,W[t.listName][e.name]=e.value,W);n(14,Q=!0)},({detail:t})=>{Ae(t.item.name)},()=>v.result.resultDef[0].button?.designation||"Dokument erstellen",()=>{n(13,X=!0)},Te,Ne,async()=>{if(Gt&&I){(await Request.deleteData(Gt,I)).taskId?(toasts.success("Die Daten wurden gelöscht.",3e3),ue()):toasts.failed("Die Daten können nicht gelöscht werden!",3e3)}Te()},async()=>{if(!Tt)return;const t=Ct.input.class[0].name,e=Ct.input.class[1].destination.split(".")[1];if(!t)return;if(!e)return;if(!W[t])return;const n=W[e]?.length||0;await fe(t,W[t],!0),n<W[e].length?($e({detail:{listName:e,value:W[e]}}),le({})):toasts.failed("Keine Positionen gefunden!",3e3)},()=>{I&&le({_docAsync:!0})},De,async({detail:t})=>{if(n(29,Pt=!1),n(26,xt=""),n(25,Dt=t.text||""),!Dt)return;const e=readSwissQR(Dt);for(const t in e){if(v.items.find(e=>e.name===t))if("object"==typeof e[t]){let r={};for(const o in e[t])if("object"==typeof e[t][o])for(const i in e[t][o]){e[t][o][i]&&(r[i]=e[t][o][i]);const a=await Request.getSectionView(o,r);if(a?.length){const e=await Request.getSectionView(t,{[o]:a[0]._id});e?.length&&n(10,W[t]=e[0]._id,W)}}else{e[t][o]&&(r[o]=e[t][o]);const i=await Request.getSectionView(t,r);i?.length&&n(10,W[t]=i[0]._id,W)}}else e[t]&&n(10,W[t]=e[t],W)}n(24,bt=!1)},()=>v.items.filter(t=>t.properties?.reader),(t,e=!1)=>e?(xe(),""):v.items.find(e=>e.name===t)?.designation||"",xe,()=>{const{refItem:t}=$t,e={[t]:Ot};let n;v.filter(t=>t.properties?.reader).forEach(t=>{const n=document.getElementById("reader_"+t.name);n&&(e[t.name]=n.value||("number"===t.type?0:""))});let r=rec;const o=r.findIndex(e=>e[t]===Ot);o>=0?(n=r[o],r[o]={...n,...e}):r=r.slice(0,-1).concat(e),rec=r,v.filter(t=>t.properties?.reader).forEach(t=>{notify(t,o>=0?o:0)({detail:{oldValue:n?n[t.name]:"",value:e[t.name]}})}),Bt=!0,xe()},()=>{Bt&&(Bt=!1,le({}))},T,N,E,k,D,O,L,q,function(t){nt=t,n(17,nt)},function(t){rt=t,n(18,rt)},function(t){qt=t,n(31,qt)},function(t){Yt=t,n(37,Yt)},()=>Te(),function(t){X=t,n(13,X)},function(t){Mt=t,n(28,Mt)},function(t){bt=t,n(24,bt)},()=>Ne(),function(t){Nt=t,n(41,Nt)},()=>{n(8,P=!1)},function(t){P=t,n(8,P)}]}class Index extends SvelteComponent{constructor(t){super(),document_1.getElementById("svelte-lfqa43-style")||add_css(),init(this,t,instance$1,create_fragment$1,safe_not_equal,{schema:0,recID:2,deletable:3,prevEventID:99,prev:4,taskId:1,taskOrg:100,description:97,root:5,readonly:98,isStandalone:101,shortEdit:6,shortSchema:102},[-1,-1,-1,-1,-1,-1,-1])}}function create_default_slot(t){let e,n,r;function o(e){t[4](e)}let i={schema:t[5],recID:t[6]};return void 0!==t[0]&&(i.description=t[0]),e=new Index({props:i}),binding_callbacks.push(()=>bind(e,"description",o)),e.$on("back",t[2]),{c(){create_component(e.$$.fragment)},m(t,n){mount_component(e,t,n),r=!0},p(t,r){const o={};32&r&&(o.schema=t[5]),64&r&&(o.recID=t[6]),!n&&1&r&&(n=!0,o.description=t[0],add_flush_callback(()=>n=!1)),e.$set(o)},i(t){r||(transition_in(e.$$.fragment,t),r=!0)},o(t){transition_out(e.$$.fragment,t),r=!1},d(t){destroy_component(e,t)}}}function create_fragment(t){let e,n;return e=new Page({props:{update:t[1],description:t[0],$$slots:{default:[create_default_slot,({prop:{schema:t,recID:e,eventID:n}})=>({5:t,6:e,7:n}),({prop:t})=>(t?32:0)|(t?64:0)|(t?128:0)]},$$scope:{ctx:t}}}),{c(){create_component(e.$$.fragment)},m(t,r){mount_component(e,t,r),n=!0},p(t,[n]){const r={};1&n&&(r.description=t[0]),353&n&&(r.$$scope={dirty:n,ctx:t}),e.$set(r)},i(t){n||(transition_in(e.$$.fragment,t),n=!0)},o(t){transition_out(e.$$.fragment,t),n=!1},d(t){destroy_component(e,t)}}}function instance(t,e,n){let r,{refresh:o}=e;return t.$$set=t=>{"refresh"in t&&n(3,o=t.refresh)},[r,(t,e)=>Request.getSchema(t).then(n=>({schema:n,recID:e,eventID:t,title:n.identity.designation})),t=>{},o,function(t){r=t,n(0,r)}]}class Detail extends SvelteComponent{constructor(t){super(),init(this,t,instance,create_fragment,safe_not_equal,{refresh:3})}}var singleSpaSvelte_1=createCommonjsModule(function(t,e){function n(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function r(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){o(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function i(t){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},i(t)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(t){if("object"!==i(t))throw new Error("single-spa-svelte requires a configuration object");var e=r(r({},a),t);if(!e.component)throw new Error("single-spa-svelte must be passed opts.component");var n={};return{bootstrap:s.bind(null,e,n),mount:c.bind(null,e,n),unmount:l.bind(null,e,n),update:d.bind(null,e,n)}};var a={component:null,domElementGetter:null,props:{}};function s(t){return Promise.resolve()}function c(t,e,n){var o=Object.keys(a),i=Object.keys(t).reduce(function(e,n){return o.includes(n)||(e[n]=t[n]),e},{});return Promise.resolve().then(function(){var o=function(t,e){return(e=e&&e.customProps?e.customProps:e).domElement?function(){return e.domElement}:e.domElementGetter?function(){return e.domElementGetter(e)}:t.domElementGetter?function(){return t.domElementGetter(e)}:function(t){var e=t.appName||t.name;if(!e)throw Error("single-spa-svelte was not given an application name as a prop, so it can't make a unique dom element container for the svelte application");var n="single-spa-application:".concat(e);return function(){var t=document.getElementById(n);return t||((t=document.createElement("div")).id=n,document.body.appendChild(t)),t}}(e)}(t,n),a=o();e.instance=new t.component(r(r({},i),{},{target:a,props:Object.assign({},n,t.props)}))})}function l(t,e){return Promise.resolve().then(function(){e.instance.$destroy?e.instance.$destroy():e.instance.destroy()})}function d(t,e,n){return Promise.resolve().then(function(){e.instance.$set?e.instance.$set(n):e.instance.set(n)})}}),singleSpaSvelte=getDefaultExportFromCjs(singleSpaSvelte_1);const lcDetail=singleSpaSvelte({component:Detail,domElementGetter:()=>document.getElementById("detail-app")}),{bootstrap:bootstrap,mount:mount,unmount:unmount}=lcDetail;exports({bootstrap:bootstrap,mount:mount,unmount:unmount});const Form=exports("Form",Index),List=exports("List",List$1),Template=exports("Template",Template$1)}}});
|